【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“frmaddstaff.frm”一文,供大家参考学习!
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmaddstaff
BorderStyle = 1 'Fixed Single
Caption = "添加卫生检查工作人员信息"
ClientHeight = 4965
ClientLeft = 4065
ClientTop = 3000
ClientWidth = 7590
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4965
ScaleWidth = 7590
Begin VB.TextBox Text9
BackColor = &H8000000E&
Height = 375
Left = 6240
TabIndex = 15
Top = 3000
Width = 1215
End
Begin VB.TextBox staffnum
BackColor = &H8000000E&
Height = 375
Left = 480
TabIndex = 14
Top = 1560
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "取消添加"
Height = 375
Left = 4320
Style = 1 'Graphical
TabIndex = 11
Top = 3840
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确认添加"
Height = 375
Left = 1200
Style = 1 'Graphical
TabIndex = 10
Top = 3840
Width = 1215
End
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 375
Left = 0
TabIndex = 8
Top = 4590
Width = 7590
_ExtentX = 13388
_ExtentY = 661
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 13335
Text = "添加卫生检查工作人员"
TextSave = "添加卫生检查
工作人员"
EndProperty
EndProperty
End
Begin VB.TextBox Text8
BackColor = &H8000000E&
Height = 375
Left = 4800
TabIndex = 7
Top = 3000
Width = 1215
End
Begin VB.TextBox Text7
BackColor = &H8000000E&
Height = 375
Left = 3360
TabIndex = 6
Top = 3000
Width = 1215
End
Begin VB.TextBox Text6
BackColor = &H8000000E&
Height = 375
Left = 1920
TabIndex = 5
Top = 3000
Width = 1215
End
Begin VB.TextBox Text5
BackColor = &H8000000E&
Height = 375
Left = 480
TabIndex = 4
Top = 3000
Width = 1215
End
Begin
VB.TextBox Text4
BackColor = &H8000000E&
Height = 375
Left = 6240
TabIndex = 3
Top = 1560
Width = 1215
End
Begin VB.TextBox Text3
BackColor = &H8000000E&
Height = 375
Left = 4800
TabIndex = 2
Top = 1560
Width = 1215
End
Begin VB.TextBox Text2
BackColor = &H8000000E&
Height = 375
Left = 3360
TabIndex = 1
Top = 1560
Width = 1215
End
Begin VB.TextBox Text1
BackColor = &H8000000E&
Height = 375
Left = 1920
TabIndex = 0
Top = 1560
Width = 1215
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "年龄 性别 职位 电话 备注 "
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 13
Top = 2640
Width = 8175
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = " 编号 栋号 宿舍号 "
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 12
Top = 1080
Width = 8535
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "添加卫生检查工作人员信息"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 2040
TabIndex = 9
Top = 240
Width = 3855
End
End
Attribute VB_Name = "frmaddstaff"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
Dim txtSQL As String
Dim MsgText As String
Dim rs As Boolean
rs = True
If Not Testtxt(staffnum.Text) Then
MsgBox "请输入编号", vbOKOnly + vbExclamation, "警告"
staffnum.Text = ""
staffnum.SetFocus
Exit Sub
End If
If Not Testtxt(Text1.Text) Then
MsgBox "请输入栋号!", vbOKOnly + vbExclamation, "警告"
Text1.Text = ""
Text1.SetFocus
Exit Sub
End If
If Not Testtxt(Text2.Text) Then
MsgBox "请输入寝室号!", vbOKOnly + vbExclamation, "警告"
Text2.Text = ""
Text2.SetFocus
Exit Sub
End If
If Not Testtxt(Text3.Text) Then
MsgBox "请输入!", vbOKOnly + vbExclamation, "警告"
Text3.Text = ""
Text3.SetFocus
Exit Sub
End If
If Not Testtxt(Text4.Text) Then
MsgBox "请输入!", vbOKOnly + vbExclamation, "警告"
Text4.Text = ""
Text4.SetFocus
Exit Sub
End If
If Not Testtxt(Text5.Text) Then
MsgBox "请输入年龄!", vbOKOnly + vbExclamation, "警告"
Text5.Text = ""
Text5.SetFocus
Exit Sub
End If
If Not Testtxt(Text6.Text) Then
MsgBox "请输入性别!", vbOKOnly + vbExclamation, "警告"
Text6.Text = ""
Text6.SetFocus
Exit Sub
Else
If Text6.Text <> "男" And Text6.Text <> "女" Then
MsgBox "输入性别有错误!", vbOKOnly + vbExclamation, "警告"
Text6.Text = ""
Text6.SetFocus
Exit Sub
End If
End If
If Not Testtxt(Text7.Text) Then
MsgBox "请输入职位!", vbOKOnly + vbExclamation, "警告"
Text7.Text = ""
Text7.S