📄 添加用户.frm
字号:
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 8760
Locked = -1 'True
TabIndex = 1
Text = "Text1"
Top = 360
Width = 2655
End
Begin VB.Label Label5
Caption = "用户级别:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7200
TabIndex = 8
Top = 3240
Width = 1455
End
Begin VB.Label Label4
Caption = "真实姓名:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7200
TabIndex = 6
Top = 2460
Width = 1455
End
Begin VB.Label Label3
Caption = "密码确认:"
Enabled = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7200
TabIndex = 4
Top = 1680
Width = 1335
End
Begin VB.Label Label2
Caption = "密码:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7200
TabIndex = 2
Top = 1020
Width = 975
End
Begin VB.Label Label1
Caption = "用户名:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7200
TabIndex = 0
Top = 360
Width = 1095
End
End
Attribute VB_Name = "添加用户"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Combo1.Text = "" Then
MsgBox "请选择管理员权限!", vbOKOnly, "提示框"
Else
Command5.SetFocus
End If
End If
End Sub
Private Sub Command1_Click()
Text1.Locked = False
Text2.Locked = False
Text4.Locked = False
Combo1.Locked = False
Command5.Enabled = True
Label3.Enabled = True
Text3.Enabled = True
Combo1.ListIndex = 1
If Data1.Recordset.EOF Then
Data1.Recordset.AddNew
Else
Data1.Recordset.MoveLast
Data1.Recordset.AddNew
End If
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
If Text10.Text = "" Then
MsgBox "请输入相关数据", vbOKOnly, "提示框"
Else
If Combo2.ListIndex = 0 Then
Data1.Recordset.FindFirst "UserName='" & Text10.Text & " '"
If (Data1.Recordset.NoMatch) Then
MsgBox "你要找的内容未找到!", vbCritical, "提示框"
Text10.Text = ""
Text10.SetFocus
End If
ElseIf Combo2.ListIndex = 1 Then
Data1.Recordset.FindFirst "TrueName='" & Text10.Text & " '"
If (Data1.Recordset.NoMatch) Then
MsgBox "你要找的内容未找到!", vbCritical, "提示框"
Text10.Text = ""
Text10.SetFocus
End If
ElseIf Combo2.ListIndex = 2 Then
Data1.Recordset.FindFirst "VIP='" & Text10.Text & " '"
If (Data1.Recordset.NoMatch) Then
MsgBox "你要找的内容未找到!", vbCritical, "提示框"
Text10.Text = ""
Text10.SetFocus
End If
End If
End If
Text15.Text = Text10.Text
End Sub
Private Sub Command5_Click()
If Text1.Text = "" Then
MsgBox "请输入用户名!", vbOKOnly, "提示框"
ElseIf Text2.Text = "" Then
MsgBox "请输入用户密码!", vbOKOnly, "提示框"
ElseIf Text3.Text = "" Then
MsgBox "请输入用户确认密码!", vbOKOnly, "提示框"
ElseIf Text4.Text = "" Then
MsgBox "请输入用户真实姓名!", vbOKOnly, "提示框"
ElseIf Text2.Text <> Text3.Text Then
MsgBox "用户密码与确认密码不相同!", vbOKOnly, "提示框"
Else
Data1.Recordset.Update
Data1.Refresh
Text3.Text = ""
Text1.Locked = True
Text2.Locked = True
Text4.Locked = True
Text3.Enabled = False
Combo1.Locked = True
Command5.Enabled = False
Label3.Enabled = False
End If
End Sub
Private Sub Command6_Click()
Text1.Locked = False
Text2.Locked = False
Text4.Locked = False
Combo1.Locked = False
Command5.Enabled = True
Label3.Enabled = True
Text3.Enabled = True
Data1.Recordset.Edit
End Sub
Private Sub Command7_Click()
Dim answer As String
answer = MsgBox("确定要删除该用户吗?", vbYesNo, "提示框")
If answer = vbYes Then
Data1.Recordset.Delete
Data1.Refresh
End If
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path + "\" + "jjdd.mdb"
Data1.Refresh
Combo1.AddItem ("一般工作人员")
Combo1.AddItem ("业务办理人员")
Combo1.AddItem ("管理人员")
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "" Then
MsgBox "请输入用户名", vbOKOnly, "提示框"
Text1.SetFocus
Else
Text2.SetFocus
End If
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text2.Text = "" Then
MsgBox "请输入密码", vbOKOnly, "提示框"
Text2.SetFocus
Else
Text3.SetFocus
End If
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text3.Text = "" Then
MsgBox "请重新输入密码", vbOKOnly, "提示框"
Text3.SetFocus
Else
Text4.SetFocus
End If
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text4.Text = "" Then
MsgBox "请输入真实姓名", vbOKOnly, "提示框"
Text4.SetFocus
Else
Combo1.SetFocus
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -