📄 ruzhu.frm
字号:
VERSION 5.00
Begin VB.Form ruzhud
Caption = "入住登记"
ClientHeight = 4020
ClientLeft = 60
ClientTop = 345
ClientWidth = 5265
LinkTopic = "Form1"
ScaleHeight = 4020
ScaleWidth = 5265
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Combo1
Height = 300
Left = 1080
TabIndex = 13
Top = 600
Width = 735
End
Begin VB.TextBox txtItem
Height = 375
Index = 4
Left = 1080
TabIndex = 12
Top = 2880
Width = 1095
End
Begin VB.TextBox txtItem
Height = 375
Index = 3
Left = 1080
TabIndex = 11
Top = 2400
Width = 1215
End
Begin VB.CommandButton cmdexit
Caption = "取消"
Height = 495
Left = 2760
TabIndex = 8
Top = 3360
Width = 1215
End
Begin VB.CommandButton cmdsave
Caption = "保存"
Height = 495
Left = 480
TabIndex = 7
Top = 3240
Width = 1215
End
Begin VB.TextBox txtItem
Height = 375
Index = 2
Left = 1080
TabIndex = 6
Top = 1680
Width = 1455
End
Begin VB.TextBox txtItem
Height = 375
Index = 1
Left = 1080
TabIndex = 5
Top = 1080
Width = 1935
End
Begin VB.PictureBox Picture1
Height = 2535
Left = 3240
Picture = "ruzhu.frx":0000
ScaleHeight = 2475
ScaleWidth = 1275
TabIndex = 4
Top = 240
Width = 1335
End
Begin VB.TextBox txtItem
Height = 375
Index = 0
Left = 1200
TabIndex = 1
Top = 120
Width = 1455
End
Begin VB.Label Label2
Caption = "性别"
Height = 255
Left = 240
TabIndex = 14
Top = 600
Width = 615
End
Begin VB.Label Label6
Caption = "帐单号"
Height = 255
Left = 120
TabIndex = 10
Top = 2880
Width = 615
End
Begin VB.Label Label5
Caption = "房间号"
Height = 255
Left = 120
TabIndex = 9
Top = 2400
Width = 615
End
Begin VB.Label Label4
Caption = "入住日期"
Height = 375
Left = 120
TabIndex = 3
Top = 1800
Width = 855
End
Begin VB.Label Label3
Caption = "身份证号"
Height = 255
Left = 120
TabIndex = 2
Top = 1200
Width = 855
End
Begin VB.Label Label1
Caption = "姓名"
Height = 255
Left = 120
TabIndex = 0
Top = 120
Width = 495
End
End
Attribute VB_Name = "ruzhud"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'是否改动过记录,ture为改过
Dim mblChange As Boolean
Dim mrc As ADODB.Recordset
Public txtSQL As String
Private Sub cmdexit_Click()
If mblChange And cmdsave.Enabled Then
If MsgBox("保存当前记录的变化吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
'保存
Call cmdSave_Click
End If
End If
Unload Me
End Sub
Private Sub cmdSave_Click()
Dim str_sex As String
Dim intCount As Integer
Dim sMeg As String
Dim mrcc As ADODB.Recordset
Dim MsgText As String
For intCount = 0 To 2
If Trim(txtItem(intCount) & " ") = "" Then
Select Case intCount
Case 0
sMeg = "姓名"
Case 1
sMeg = "性别"
End Select
sMeg = sMeg & "不能为空!"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
txtItem(intCount).SetFocus
Exit Sub
End If
Next intCount
Combo1.AddItem "男"
Combo1.AddItem "女"
'再加入新记录
txtSQL = "select * from bookin"
Set mrc = ExecuteSQL(txtSQL, MsgText)
mrc.AddNew
mrc.Fields(0) = Trim(txtItem(4))
mrc.Fields(1) = Trim(txtItem(0))
mrc.Fields(2) = Trim(txtItem(1))
mrc.Fields(3) = Trim(txtItem(3))
mrc.Fields(4) = Trim(txtItem(2))
mrc.Fields(9) = Trim(Combo1)
mrc.Update
mrc.Close
Unload Me
End Sub
Private Sub Form_Load()
Combo1.AddItem "男"
Combo1.AddItem "女"
End Sub
Private Sub txtItem_Change(Index As Integer)
'有变化设置gblchange
mblChange = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -