录入信息.frm
来自「C/S模块」· FRM 代码 · 共 226 行
FRM
226 行
VERSION 5.00
Begin VB.Form Form12
BackColor = &H00FFC0C0&
Caption = "Form12"
ClientHeight = 6135
ClientLeft = 60
ClientTop = 450
ClientWidth = 8835
LinkTopic = "Form12"
Picture = "录入信息.frx":0000
ScaleHeight = 6135
ScaleWidth = 8835
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "录入员工信息界面"
Height = 5055
Index = 0
Left = 1200
TabIndex = 0
Top = 240
Width = 5295
Begin VB.TextBox Text5
Height = 495
Left = 2640
TabIndex = 14
Top = 3480
Width = 2175
End
Begin VB.TextBox Text4
Height = 495
Left = 2640
TabIndex = 13
Top = 2760
Width = 2175
End
Begin VB.TextBox Text3
Height = 495
Left = 2640
TabIndex = 12
Top = 2040
Width = 2175
End
Begin VB.TextBox Text1
Height = 495
Left = 2640
TabIndex = 11
Top = 600
Width = 2175
End
Begin VB.TextBox Text2
Height = 495
Left = 2640
TabIndex = 10
Top = 1320
Width = 2175
End
Begin VB.CommandButton Command3
Caption = "录入"
Height = 495
Left = 2640
Picture = "录入信息.frx":9224
Style = 1 'Graphical
TabIndex = 9
Top = 4200
Width = 2175
End
Begin VB.CommandButton Command2
BackColor = &H00000000&
Caption = "返回"
Height = 495
Left = 600
Picture = "录入信息.frx":11AFA
Style = 1 'Graphical
TabIndex = 8
Top = 4200
Width = 1575
End
Begin VB.OptionButton Option2
BackColor = &H00FFC0C0&
Caption = "女"
Height = 255
Left = 3360
TabIndex = 7
Top = 240
Width = 855
End
Begin VB.OptionButton Option1
BackColor = &H00FFC0C0&
Caption = "男"
Height = 375
Left = 1680
TabIndex = 6
Top = 120
Width = 855
End
Begin VB.CommandButton Command1
Caption = "工资"
Height = 495
Index = 7
Left = 600
Picture = "录入信息.frx":1A3D0
Style = 1 'Graphical
TabIndex = 5
Top = 3480
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "员工号"
Height = 495
Index = 3
Left = 600
Picture = "录入信息.frx":22CA6
Style = 1 'Graphical
TabIndex = 4
Top = 1320
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "地址"
Height = 495
Index = 2
Left = 600
Picture = "录入信息.frx":2B57C
Style = 1 'Graphical
TabIndex = 3
Top = 2040
Width = 1575
End
Begin VB.CommandButton Command1
BackColor = &H00FFC0C0&
Caption = "员工姓名"
Height = 495
Index = 1
Left = 600
Picture = "录入信息.frx":33E52
Style = 1 'Graphical
TabIndex = 2
Top = 600
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "联系电话"
Height = 495
Index = 4
Left = 600
Picture = "录入信息.frx":3C728
Style = 1 'Graphical
TabIndex = 1
Top = 2760
Width = 1575
End
End
End
Attribute VB_Name = "Form12"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim wm12 As String
Public bank12 As String
Public yg12 As String
Private Sub Command2_Click()
Unload Me
Form11.Show
End Sub
Private Sub Command3_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Then
MsgBox "请填写完整信息!"
Text1.SetFocus
Exit Sub
ElseIf Option1.Value = False And Option2.Value = False Then
MsgBox "请选择男女!"
Exit Sub
ElseIf Not IsNumeric(Text2.Text) Then
MsgBox "员工号为数字"
Text2.SetFocus
Exit Sub
ElseIf Len(Text2.Text) <> 4 Then
MsgBox "员工号为4位"
Text2.SetFocus
Exit Sub
ElseIf Not IsNumeric(Text4.Text) Then
MsgBox "电话号必须全为数字"
Text4.SetFocus
Exit Sub
ElseIf Not IsNumeric(Text5.Text) Then
MsgBox "工资为数字"
Text5.SetFocus
Exit Sub
Else
Call openconn
rs.Open "select * from employee_xx053_06 where e_No='" & Trim(Text2.Text) & "'", conn, adOpenDynamic, adLockOptimistic
If rs.BOF And rs.EOF Then
conn.Execute "insert into employee_xx053_06 values('" & Trim(Text2.Text) & "','" & Trim(Text1.Text) & "','" & Trim(Text3.Text) & "','" & bank12 & "','" & Trim(Text5.Text) & "','" & yg12 & "','222222','你的初始密码是什么?','222222','" & wm12 & "')"
rs.Close
MsgBox "录入员工信息成功"
MsgBox "您的初始密码是:222222"
Unload Me
Form11.Show
Else
MsgBox "该员工号已存在!录入失败"
rs.Close
Unload Me
Form11.Show
End If
conn.Close
End If
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
wm12 = "男"
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
wm12 = "女"
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?