📄 setuser1.frm
字号:
VERSION 5.00
Begin VB.Form setuser1
Caption = "编辑系统用户"
ClientHeight = 4380
ClientLeft = 60
ClientTop = 465
ClientWidth = 5850
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4380
ScaleWidth = 5850
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmd_cancel
Caption = "取消"
Height = 495
Left = 3120
TabIndex = 5
Top = 3720
Width = 1095
End
Begin VB.CommandButton cmd_ok
Caption = "确定"
Height = 495
Left = 960
TabIndex = 4
Top = 3720
Width = 1095
End
Begin VB.Frame Frame1
Caption = "用户编辑"
Height = 3015
Left = 360
TabIndex = 0
Top = 480
Width = 4935
Begin VB.TextBox txtpwd
Height = 375
Left = 2040
MaxLength = 6
TabIndex = 8
Top = 1380
Width = 1815
End
Begin VB.TextBox txtusername
Height = 375
Left = 2040
MaxLength = 10
TabIndex = 7
Top = 600
Width = 1815
End
Begin VB.ComboBox cmblevel
Height = 300
ItemData = "setuser1.frx":0000
Left = 2040
List = "setuser1.frx":000A
TabIndex = 6
Text = "管理员"
Top = 2160
Width = 1815
End
Begin VB.Label Label3
Caption = "用户级别"
Height = 375
Left = 720
TabIndex = 3
Top = 2280
Width = 975
End
Begin VB.Label Label2
Caption = "口令"
Height = 375
Left = 720
TabIndex = 2
Top = 1500
Width = 975
End
Begin VB.Label Label1
Caption = "用户名"
Height = 375
Left = 720
TabIndex = 1
Top = 720
Width = 975
End
End
End
Attribute VB_Name = "setuser1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmblevel_KeyPress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub cmd_cancel_Click()
Unload Me
End Sub
Private Sub cmd_ok_Click()
On Error GoTo err1
If Trim(txtusername.Text) = "" Or Trim(txtpwd.Text) = "" Or Trim(cmblevel.Text) = "" Then
MsgBox "数据项目不全,请重置", vbOKOnly, "信息提示"
txtusername.SetFocus
Exit Sub
End If
If flag = 1 Then
setuser.Adodc1.Recordset.AddNew
setuser.Adodc1.Recordset.Fields("用户名") = Trim(txtusername.Text)
setuser.Adodc1.Recordset.Fields("口令") = Val(txtpwd.Text)
setuser.Adodc1.Recordset.Fields("级别") = Trim(cmblevel.Text)
setuser.Adodc1.Recordset.Update
recs = recs + 1
Else
setuser.Adodc1.Recordset.Fields("用户名") = Trim(txtusername.Text)
setuser.Adodc1.Recordset.Fields("口令") = Val(txtpwd.Text)
setuser.Adodc1.Recordset.Fields("级别") = Trim(cmblevel.Text)
setuser.Adodc1.Recordset.Update
End If
Unload Me
Exit Sub
err1:
MsgBox "数据重复", vbOKOnly + vbInformation, "系统提示"
Unload Me
End Sub
Private Sub Form_Load()
If flag = 2 Then
txtusername.Text = setuser.Adodc1.Recordset.Fields("用户名")
txtpwd.Text = setuser.Adodc1.Recordset.Fields("口令")
cmblevel.Text = setuser.Adodc1.Recordset.Fields("级别")
End If
End Sub
Private Sub txtpwd_KeyPress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
Private Sub txtusername_KeyPress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -