📄 frmuserone.frm
字号:
VERSION 5.00
Begin VB.Form frmUserOne
BorderStyle = 3 'Fixed Dialog
Caption = "一个人员"
ClientHeight = 1350
ClientLeft = 5925
ClientTop = 6225
ClientWidth = 3690
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1350
ScaleWidth = 3690
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtCode
Height = 285
Left = 120
MaxLength = 4
TabIndex = 1
Top = 360
Width = 1575
End
Begin VB.TextBox txtName
Height = 285
Left = 120
MaxLength = 4
TabIndex = 3
Top = 960
Width = 2055
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 345
Left = 2520
TabIndex = 4
Top = 203
Width = 1065
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 345
Left = 2520
TabIndex = 5
Top = 803
Width = 1065
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "人员代码(&C):"
Height = 180
Left = 120
TabIndex = 0
Top = 120
Width = 1080
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "人员名称(&N):"
Height = 180
Left = 120
TabIndex = 2
Top = 720
Width = 1080
End
End
Attribute VB_Name = "frmUserOne"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_bFunc As Boolean
Private m_sCode As String
Private m_sName As String
Public OK As Boolean
Public Property Let ubFunc(ByVal NewFunc As Boolean)
m_bFunc = NewFunc
End Property
Public Property Get ubFunc() As Boolean
ubFunc = m_bFunc
End Property
Public Property Let usCode(ByVal NewCode As String)
m_sCode = NewCode
End Property
Public Property Get usCode() As String
usCode = m_sCode
End Property
Public Property Let usName(ByVal NewName As String)
m_sName = NewName
End Property
Public Property Get usName() As String
usName = m_sName
End Property
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOk_Click()
Dim rSt As ADODB.Recordset
Dim str As String
m_sCode = txtCode.text
If m_sCode = "" Then
MsgBox "代码不能为空!", vbInformation, "提示"
txtCode.SetFocus
Exit Sub
End If
str = UCase(Mid(txtCode.text, 1, 1))
If IsNumeric(str) Then
MsgBox "代码不能为空且第一个字符不能为数字!", vbInformation, "提示"
txtCode.SetFocus
Exit Sub
End If
If Trim(txtName.text) = "" Then
MsgBox "人员名称名称不能为空!", vbInformation, "提示"
Exit Sub
End If
If Me.ubFunc Then
Set rSt = New ADODB.Recordset
rSt.CursorLocation = adUseClient
rSt.Open "select * from tSYS_user where userID='" & m_sCode & "'", _
gloSys.cnnSys, adOpenStatic, adLockReadOnly
If rSt.RecordCount <> 0 Then
MsgBox "该代码已存在!", vbInformation, "提示"
txtCode.SelStart = 0
txtCode.SelLength = Len(txtCode.text)
txtCode.SetFocus
Exit Sub
End If
End If
m_sName = txtName.text
OK = True
Me.Hide
End Sub
Private Sub Form_Initialize()
OK = False
End Sub
Private Sub Form_Load()
txtCode.text = Me.usCode
txtName.text = Me.usName
If Not Me.ubFunc Then
txtCode.Enabled = False
txtCode.BackColor = vb3DLight
End If
End Sub
Private Sub txtCode_KeyPress(KeyAscii As Integer)
KeyAscii = NumberORLetterEnabled(KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -