📄 修改员工信息.frm
字号:
VERSION 5.00
Begin VB.Form Form5
BackColor = &H00FFC0C0&
Caption = "Form5"
ClientHeight = 5445
ClientLeft = 60
ClientTop = 450
ClientWidth = 8820
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form5"
Picture = "修改员工信息.frx":0000
ScaleHeight = 5445
ScaleWidth = 8820
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "管理员修改信息"
ForeColor = &H00FF0000&
Height = 3975
Left = 1920
TabIndex = 0
Top = 480
Width = 4575
Begin VB.TextBox Text5
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 13
Top = 2640
Width = 2175
End
Begin VB.CommandButton Command5
Caption = "修改的员工号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
Picture = "修改员工信息.frx":9224
Style = 1 'Graphical
TabIndex = 12
Top = 2640
Width = 1455
End
Begin VB.CommandButton Command4
Caption = "显示"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
Picture = "修改员工信息.frx":11AFA
Style = 1 'Graphical
TabIndex = 11
Top = 3240
Width = 1095
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 10
Top = 2040
Width = 2175
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 9
Top = 1440
Width = 2175
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 8
Top = 840
Width = 2175
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 7
Top = 240
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "修改"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
Picture = "修改员工信息.frx":1A3D0
Style = 1 'Graphical
TabIndex = 6
Top = 3240
Width = 975
End
Begin VB.CommandButton Command2
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 0
Left = 240
Picture = "修改员工信息.frx":22CA6
Style = 1 'Graphical
TabIndex = 5
Top = 240
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "工资"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 1
Left = 240
Picture = "修改员工信息.frx":2B57C
Style = 1 'Graphical
TabIndex = 4
Top = 840
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "主管号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 2
Left = 240
Picture = "修改员工信息.frx":33E52
Style = 1 'Graphical
TabIndex = 3
Top = 2040
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "地址"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 3
Left = 240
Picture = "修改员工信息.frx":3C728
Style = 1 'Graphical
TabIndex = 2
Top = 1440
Width = 1455
End
Begin VB.CommandButton Command3
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
Picture = "修改员工信息.frx":44FFE
Style = 1 'Graphical
TabIndex = 1
Top = 3240
Width = 1455
End
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public yg5 As String
Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Then
MsgBox "请填写完整要修改的员工号信息!"
Text1.SetFocus
Exit Sub
ElseIf Not IsNumeric(Text2.Text) Then
MsgBox "工资为数字"
Text2.SetFocus
Exit Sub
ElseIf Not IsNumeric(Text4.Text) Then
MsgBox "主管号为数字"
Text4.SetFocus
Exit Sub
ElseIf Len(Text4.Text) <> 4 Then
MsgBox "主管号为4位"
Text4.SetFocus
Exit Sub
Else
Call openconn
rs.Open "select * from employee_xx053_06 where e_No='" & Trim(Text5.Text) & "'", conn, adOpenDynamic, adLockOptimistic
rs.Fields(1) = Trim(Text1.Text)
rs.Fields(4) = Trim(Text2.Text)
rs.Fields(2) = Trim(Text3.Text)
rs.Fields(5) = Trim(Text4.Text)
rs.Update
rs.Close
MsgBox "修改成功!"
Unload Me
Form11.Show
End If
End Sub
Private Sub Command3_Click()
Unload Me
Form11.Show
End Sub
Private Sub Command4_Click()
If Text5.Text = "" Then
MsgBox "请填写要修改的员工号信息!"
Text1.SetFocus
Exit Sub
ElseIf Not IsNumeric(Text5.Text) Then
MsgBox "员工号为数字"
Text5.SetFocus
Exit Sub
ElseIf Len(Text5.Text) <> 4 Then
MsgBox "员工号为4位"
Text5.SetFocus
Exit Sub
Else
Call openconn
rs.Open "select * from employee_xx053_06 where e_No='" & Trim(Text5.Text) & "'and manager='" & yg5 & "'", conn, adOpenDynamic, adLockOptimistic
If rs.BOF And rs.EOF Then
rs.Close
MsgBox "你没有权限修改改员工信息"
Unload Me
Form11.Show
Else
If rs!e_name = Null Then
Text1.Text = ""
Else
Text1.Text = rs!e_name
End If
If rs!wage = Null Then
Text2.Text = ""
Else
Text2.Text = rs!wage
End If
If rs!addr = Null Then
Text3.Text = ""
Else
Text3.Text = rs!addr
End If
If rs!manager = Null Then
Text4.Text = ""
Else
Text4.Text = rs!manager
End If
rs.Close
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = False
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -