📄 kfdj.frm
字号:
Top = 240
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "房号:"
Height = 180
Left = 120
TabIndex = 6
Top = 240
Width = 450
End
End
Begin VB.Frame Frame1
Caption = "房间状态:"
Height = 5175
Left = 0
TabIndex = 0
Top = 0
Width = 3735
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "kfdj.frx":0000
Height = 4815
Left = 120
TabIndex = 1
Top = 240
Width = 3495
_ExtentX = 6165
_ExtentY = 8493
_Version = 393216
AllowUpdate = 0 'False
BackColor = 16777215
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 2520
Top = 6000
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=KFGL.MDB;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=KFGL.MDB;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from kf where 状态=""空房"""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "kfdjj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim rs_bookstyle As New ADODB.Recordset
Dim rs_bookstyle1 As New ADODB.Recordset
Dim conn As String
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kfgl.mdb;Persist Security Info=False"
Dim sql As String
Dim sql1 As String
If Text6.Text = "" Then
MsgBox "客人姓名不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If Combo1.Text = "" Then
MsgBox "证件名称不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If Text7.Text = "" Then
MsgBox "证件号码不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If Text8.Text = "" Then
MsgBox "证件地址不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If Text9.Text = "" Then
MsgBox "从何处来不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If Text11.Text = "" Then
MsgBox "住宿原因不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
sql = "select * from djb where 房号='" & Text1.Text & "'"
sql1 = "select * from kf where 房号='" & Text1.Text & "'"
rs_bookstyle.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_bookstyle1.Open sql1, conn, adOpenKeyset, adLockPessimistic
If rs_bookstyle1.Fields(3) = "空房" Then
rs_bookstyle.AddNew
rs_bookstyle.Fields(0) = Trim(Text1.Text)
rs_bookstyle.Fields(5) = Trim(Text2.Text)
rs_bookstyle.Fields(2) = Trim(Text3.Text)
' rs_bookstyle.Fields(3) = Trim(Text4.Text)
rs_bookstyle.Fields(4) = Trim(Text5.Text)
rs_bookstyle.Fields(1) = Trim(Text6.Text)
rs_bookstyle.Fields(6) = Trim(Combo1.Text)
rs_bookstyle.Fields(7) = Trim(Text7.Text)
rs_bookstyle.Fields(8) = Trim(Text8.Text)
rs_bookstyle.Fields(9) = Trim(Text9.Text)
rs_bookstyle.Fields(10) = Trim(Text10.Text)
rs_bookstyle.Fields(11) = Trim(Text11.Text)
rs_bookstyle.Fields(12) = Trim(Label16.Caption)
rs_bookstyle.Fields(13) = Trim(DTP1.Value)
rs_bookstyle.Fields(14) = Trim(tim1.Value)
rs_bookstyle.Fields(15) = "0"
rs_bookstyle.Fields(16) = "0"
rs_bookstyle.Fields(17) = "0"
rs_bookstyle.Update
MsgBox "订房成功!", vbOKOnly, ""
'ext4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Combo1.Text = ""
rs_bookstyle.Close
Else
MsgBox "房间已满!", vbOKOnly + vbExclamation, ""
rs_bookstyle.Close
Exit Sub
End If
rs_bookstyle1.Fields(3) = "入住"
rs_bookstyle1.Update
Adodc1.Refresh
End Sub
Private Sub Command3_Click()
'ext4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Combo1.Text = ""
DTP1.Value = Date
tim1.Value = Time
Label16.Caption = MDIForm1.StatusBar1.Panels(1).Text
Adodc1.Refresh
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Adodc1.Refresh
End Sub
Private Sub Form_Load()
Combo1.AddItem "身份证"
Combo1.AddItem "工作证"
Combo1.AddItem "户口薄"
Combo1.AddItem "军官证"
Combo1.AddItem "警官证"
Combo1.AddItem "士兵证"
Combo1.AddItem "护照"
Combo1.AddItem "其它证件证"
'Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Combo1.Text = ""
DTP1.Value = Date
tim1.Value = Time
Label16.Caption = MDIForm1.StatusBar1.Panels(1).Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -