📄 klxgfrm.frm
字号:
List = "klxgfrm.frx":0036
TabIndex = 14
Text = "Combo1"
Top = 1800
Width = 1455
End
Begin VB.TextBox Text3
Height = 300
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 13
Text = "Text3"
Top = 1080
Width = 1455
End
Begin VB.TextBox Text2
Height = 300
Left = 1200
TabIndex = 12
Text = "Text2"
Top = 720
Width = 1455
End
Begin VB.TextBox Text1
Height = 300
Left = 1200
TabIndex = 11
Text = "Text1"
Top = 360
Width = 1455
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "操作员密码:"
Height = 180
Left = 120
TabIndex = 26
Top = 1530
Width = 1080
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "操作员类别:"
Height = 180
Left = 120
TabIndex = 10
Top = 1920
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "操作员密码:"
Height = 180
Left = 120
TabIndex = 9
Top = 1140
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "操作员姓名:"
Height = 180
Left = 120
TabIndex = 8
Top = 750
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "操作员代码:"
Height = 180
Left = 120
TabIndex = 7
Top = 360
Width = 1080
End
End
End
Begin VB.Label Label11
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "操作员权限管理"
BeginProperty Font
Name = "隶书"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 525
Left = 1200
TabIndex = 28
Top = 0
Width = 3885
End
End
Attribute VB_Name = "klxgfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim zkf As Integer
Dim mdbstr6 As String
Private Sub Command1_Click()
Frame3.Enabled = True
Frame4.Enabled = False
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Combo1.Text = ""
Text1.SetFocus
zkf = 111
End Sub
Private Sub Command2_Click()
On Error GoTo er
pp = InputBox("请输入您要删除的操作员的代码?")
If pp = "" And pp = "00" Then
Exit Sub
End If
Data1.Refresh
Data1.Recordset.FindFirst "操作员代码=" + "'" + pp + "'"
If Data1.Recordset.NoMatch = False Then
kk = MsgBox("确认删除吗?", vbYesNo + 32)
If kk = 6 Then
Data1.Recordset.Delete
MsgBox "成功删除了此操作员!"
End If
Else
MsgBox "没有找到操作员,删除操作失败!"
End If
Exit Sub
er:
MsgBox "服务器连接失败。!"
End Sub
Private Sub Command3_Click()
Frame4.Enabled = True
Frame3.Enabled = False
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = True
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text4.SetFocus
zkf = 222
End Sub
Private Sub Command4_Click()
On Error GoTo er
If zkf = 111 Then
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Combo1.Text = "" Then
MsgBox "输入数据不完整,请输入完整的数据后再保存"
Exit Sub
End If
Data1.Refresh
Data1.Recordset.FindFirst "操作员代码=" + "'" + Text1.Text + "'"
If Data1.Recordset.NoMatch = False Then
MsgBox "操作员代码已经存在,不能重复操作员代码!·"
Exit Sub
End If
If Trim(Text3.Text) <> Trim(Text8.Text) Then
MsgBox "您两次输入的密码不一致!"
Text3.Text = ""
Text8.Text = ""
Text3.SetFocus
Exit Sub
End If
Data1.Recordset.AddNew
Data1.Recordset.Fields(0) = Text1.Text
Data1.Recordset.Fields(1) = Text2.Text
Data1.Recordset.Fields(2) = Text3.Text
Data1.Recordset.Fields(3) = Combo1.Text
Data1.Recordset.Update
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = False
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Combo1.Text = ""
MsgBox "添加操作员成功"
End If
If zkf = 222 Then
If Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text = "" Or Combo2.Text = "" Then
MsgBox "输入数据不完整!!!!!"
Exit Sub
End If
Data1.Refresh
Data1.Recordset.FindFirst "操作员姓名=" + "'" + Text5.Text + "'"
If Data1.Recordset.NoMatch = True Then
MsgBox "输入的操作员数据有误。!!,可能是姓名输入不正确"
Exit Sub
Else
If Text4.Text <> Data1.Recordset.Fields(2) Then
MsgBox "旧密码不正确,不能修改密码!!"
Exit Sub
End If
If Text6.Text <> Text7.Text Then
MsgBox "两次输入的密码不一致。!!"
Exit Sub
End If
Data1.Recordset.Edit
Data1.Recordset.Fields(1) = Text5.Text
Data1.Recordset.Fields(2) = Text7.Text
Data1.Recordset.Fields(3) = Combo2.Text
Data1.Recordset.Update
MsgBox "数据修改成功!"
End If
End If
Exit Sub
er:
MsgBox "服务器连接失败。!"
End Sub
Private Sub Form_Activate()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Combo1.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Combo2.Text = ""
Command1.SetFocus
End Sub
Private Sub Form_Load()
Data1.DatabaseName = dbstr
Data1.RecordSource = "czy"
Data1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -