📄 ygzlxg.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form8
BorderStyle = 3 'Fixed Dialog
Caption = "员工资料修改"
ClientHeight = 2790
ClientLeft = 45
ClientTop = 435
ClientWidth = 6240
LinkTopic = "Form8"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2790
ScaleWidth = 6240
ShowInTaskbar = 0 'False
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 480
Top = 2280
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text5
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 1440
TabIndex = 5
Top = 1080
Width = 1575
End
Begin VB.TextBox Text7
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 1440
TabIndex = 7
Top = 1622
Width = 4575
End
Begin VB.TextBox Text6
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 4680
TabIndex = 6
Top = 1080
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "删 除"
Enabled = 0 'False
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 3360
TabIndex = 8
Top = 2160
Width = 1000
End
Begin VB.CommandButton Command2
Caption = "修 改"
Enabled = 0 'False
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 5015
TabIndex = 9
Top = 2160
Width = 1000
End
Begin VB.CommandButton Command1
Caption = "输 入"
Default = -1 'True
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Left = 1680
TabIndex = 1
Top = 2160
Width = 1000
End
Begin VB.TextBox Text4
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 1440
TabIndex = 3
Top = 600
Width = 1575
End
Begin VB.TextBox Text3
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 4440
TabIndex = 4
Top = 540
Width = 1575
End
Begin VB.TextBox Text2
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 4440
TabIndex = 2
Top = 60
Width = 1575
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 1440
TabIndex = 0
Top = 120
Width = 1575
End
Begin VB.Label Label6
Caption = "是否离职:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 3240
TabIndex = 16
Top = 1138
Width = 1580
End
Begin VB.Label Label7
Caption = "地 址:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 240
TabIndex = 15
Top = 1680
Width = 1305
End
Begin VB.Label Label5
Caption = "电 话:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 240
TabIndex = 14
Top = 1138
Width = 1305
End
Begin VB.Label Label4
Caption = "部 门:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 3240
TabIndex = 13
Top = 600
Width = 1305
End
Begin VB.Label Label3
Caption = "姓 名:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 3240
TabIndex = 12
Top = 120
Width = 1305
End
Begin VB.Label Label2
Caption = "职 务:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 240
TabIndex = 11
Top = 658
Width = 1305
End
Begin VB.Label Label1
Caption = "工 号:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 240
TabIndex = 10
Top = 178
Width = 1305
End
End
Attribute VB_Name = "Form8"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Text1.Text = Trim(Text1.Text)
If Text1.Text = "" Then MsgBox "请认识填写职工工号!", 48, "消息窗口": Exit Sub
rst.Open "select * from zhigongbiao where 工号=" & Val(Text1.Text) & " ", con
If rst.EOF Then
MsgBox "不存在该职工工号!", 48, "消息窗口"
Text1.Text = ""
rst.Close
Exit Sub
End If
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Text1.Enabled = False
Command1.Enabled = False
Text2.Text = rst!姓名
bm = rst!部门编号
zhw = rst!职务编号
Text4.Text = zhw
Text5.Text = rst!电话
lz = rst!是否离职
If lz = True Then Text6.Text = "是" Else Text6.Text = "否"
Text7.Text = rst!地址
rst.Close
rst.Open "select * from bumeibiao where 编号= " & bm & "", con
Text3.Text = rst!部门名称
rst.Close
rst.Open "select * from zhiwubiao where 编号= " & zhw & "", con
Text4.Text = rst!职务名称
rst.Close
End Sub
Private Sub Command2_Click()
Text2.Text = Trim(Text2.Text)
Text3.Text = Trim(Text3.Text)
Text4.Text = Trim(Text4.Text)
Text5.Text = Trim(Text5.Text)
Text6.Text = Trim(Text6.Text)
Text7.Text = Trim(Text7.Text)
rst.Open "select * from bumeibiao where 部门名称= '" & Text3.Text & "'", con
bm = rst!编号
rst.Close
rst.Open "select * from zhiwubiao where 职务名称= '" & Text4.Text & "'", con
zhw = rst!编号
rst.Close
If Text6.Text = "是" Then lz = True Else lz = flase
my = "update zhigongbiao set 姓名='" & Text2.Text & "',职务编号=" & zhw & ",部门编号=" & bm & ",电话='" & Text5.Text & "',地址='" & Text7.Text & "',是否离职=" & lz & " where 工号=" & Val(Text1.Text) & ""
con.BeginTrans
con.Execute my
r = MsgBox("是要修改吗?", vbYesNo + vbQuestion)
If r = vbYes Then
con.CommitTrans
Adodc1.Refresh
Else
con.RollbackTrans
End If
End Sub
Private Sub Command3_Click()
my = "delete from zhigongbiao where 工号=" & Val(Text1.Text) & ""
con.BeginTrans
con.Execute my
r = MsgBox("确定要删除?", vbYesNo + vbQuestion)
If r = vbYes Then
con.CommitTrans
Adodc1.Refresh
Else
con.RollbackTrans
End If
Text1.Enabled = True
Command1.Enabled = True
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Text7.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = s
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from zhigongbiao"
Adodc1.Refresh
Form8.Top = MDIForm1.Height / 4
Form8.Left = MDIForm1.Width / 4
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -