📄 form2.frm
字号:
Text = "Combo1"
Top = 1200
Width = 2055
End
Begin VB.TextBox Text1
DataField = "姓名"
DataSource = "Adodc2"
Height = 300
Left = 1200
MaxLength = 10
TabIndex = 1
Top = 600
Width = 2055
End
Begin VB.Label Label12
BorderStyle = 1 'Fixed Single
DataField = "类型"
DataSource = "Adodc2"
Height = 300
Left = 1200
TabIndex = 22
Top = 2400
Width = 2055
End
Begin VB.Label Label11
Caption = "入住日期"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 20
Top = 5280
Width = 1095
End
Begin VB.Label Label10
Caption = "人数"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 19
Top = 4800
Width = 1095
End
Begin VB.Label Label9
Caption = "押金"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 18
Top = 4200
Width = 1095
End
Begin VB.Label Label8
Caption = "证件号码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 17
Top = 3600
Width = 1095
End
Begin VB.Label Label7
Caption = "证件类型"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 16
Top = 3000
Width = 1095
End
Begin VB.Label Label6
Caption = "类型"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 15
Top = 2400
Width = 855
End
Begin VB.Label Label5
BorderStyle = 1 'Fixed Single
DataField = "房号"
DataSource = "Adodc2"
Height = 300
Left = 1200
TabIndex = 14
Top = 1800
Width = 2055
End
Begin VB.Label Label4
Caption = "房号"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 13
Top = 1800
Width = 855
End
Begin VB.Label Label3
Caption = "性别"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 12
Top = 1200
Width = 855
End
Begin VB.Label Label2
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 11
Top = 600
Width = 855
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "客人登记基本信息"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 10
Top = 120
Width = 2775
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim num%
Private Sub Command1_Click()
If Text1 = "" Then
MsgBox "未输入姓名", , "提示"
ElseIf Combo1.Text = "" Then MsgBox "未选择性别", , "提示"
ElseIf Label5.Caption = "" Then MsgBox "未选择房号和类型", , "提示"
ElseIf Combo3.Text = "" Then MsgBox "未选择证件类型", , "提示"
ElseIf Text2 = "" Then MsgBox "未输入证件号码", , "提示"
ElseIf Text3 = "" Then MsgBox "未输入押金", , "提示"
ElseIf Text4 = "" Or Val(Text4) > num Then MsgBox "人数不对", , "提示"
ElseIf Text5 = "" Then MsgBox "日期不对", , "提示"
Else
Adodc1.Recordset.Fields(3).Value = "已满"
Adodc1.Recordset.Update
Adodc2.Recordset.Update
End If
End Sub
Private Sub Command2_Click()
Unload Me
Form1.Show
End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
If Adodc1.Recordset.Fields(3).Value = "已满" Then
MsgBox "该房间已满,请选择其他空房", , "提示"
Label5.Caption = ""
Label12.Caption = ""
Else
Label5.Caption = Adodc1.Recordset.Fields(0).Value
Label12.Caption = Adodc1.Recordset.Fields(1).Value
End If
If Label12.Caption = "标准单人房" Or Label12.Caption = "豪华单人房" Then
num = 1
Else
num = 2
End If
End Sub
Private Sub Form_Load()
Adodc2.Recordset.AddNew
Combo1.AddItem "男"
Combo1.AddItem "女"
Combo3.AddItem "身份证"
Combo3.AddItem "学生证"
End Sub
Private Sub Text5_Click()
Text5.Text = Now
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub Text3_keypress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -