📄 frrmguestroom.frm
字号:
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 9000
TabIndex = 35
Top = 720
Width = 1335
End
Begin VB.Label datelbl
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "date"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 9000
TabIndex = 34
Top = 1200
Width = 1335
End
Begin VB.Label Label17
Caption = "Checkout Date"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7560
TabIndex = 33
Top = 3120
Width = 1335
End
Begin VB.Label Label16
Caption = "Room No."
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7560
TabIndex = 32
Top = 2160
Width = 1335
End
Begin VB.Label Label15
Caption = "Guest ID"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7560
TabIndex = 31
Top = 1680
Width = 1335
End
Begin VB.Label Label13
Caption = "Transaction No."
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7560
TabIndex = 30
Top = 720
Width = 1455
End
End
Begin VB.Label lblDate
Alignment = 2 'Center
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "date"
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 9840
TabIndex = 62
Top = 120
Width = 1575
End
Begin VB.Label Label23
Alignment = 2 'Center
BackColor = &H00FF8080&
BackStyle = 0 'Transparent
Caption = "Transaction No. 1"
BeginProperty Font
Name = "Monotype Corsiva"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 495
Left = -600
TabIndex = 61
Top = 0
Width = 3375
End
End
Attribute VB_Name = "frmCheckin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public sw1, seed, eks, way, a, b, c, d, e, f, Gg, beat, x, z As Integer
Public T As Integer
Public G As Integer
Public o As Integer
Public Amount As Currency
Public TotalAmount As Integer
Dim Status As String
Dim TransType As String
Dim Guest As String
Dim Confirm As String
Dim datenow As String
Private Function ValidData() As Boolean
Dim strMessage As String
If txtLN.Text = "" Then
txtLN.SetFocus
strMessage = "Please Enter Last Name..."
ElseIf txtFN.Text = "" Then
txtFN.SetFocus
strMessage = "Please Enter First Name..."
ElseIf txtMI.Text = "" Then
txtMI.SetFocus
strMessage = "Please Enter Middle Name..."
ElseIf txtAddress.Text = "" Then
txtAddress.SetFocus
strMessage = "Please Enter Address..."
ElseIf txtAge.Text = "" Then
txtAge.SetFocus
strMessage = "Please Enter Age..."
ElseIf txtSex.Text = "" Then
txtSex.SetFocus
strMessage = "Please Enter Sex..."
ElseIf txtNationality.Text = "" Then
txtNationality.SetFocus
strMessage = "Please Enter Nationality..."
ElseIf txtTelNo.Text = "" Then
txtTelNo.SetFocus
strMessage = "Please Enter the Telephone Number..."
ElseIf txtCompany.Text = "" Then
txtCompany.SetFocus
strMessage = "Please Enter Company..."
Else
ValidData = True
End If
If Not ValidData Then
MsgBox strMessage, vbOKOnly
End If
End Function
Private Function ValidDataT() As Boolean
' check_RS1
' rs1.Open "select * from room_transaction", Cnn
Dim strMessage As String
If lblroomno.Caption = "" Then
lvroom.SetFocus
strMessage = "Please Enter the Room Number..."
ElseIf txtEndDate.Text = "" Then
txtEndDate.SetFocus
strMessage = "Please Enter the said End Date..."
ElseIf lblroomno.Caption = "" Then
strMessage = "Please Enter the Room Number to be reserved..."
lvroom.SetFocus
' ElseIf txtEndDate.Text < datelbl Then
' strMessage = "Said End Date must be higher than Date Today."
' txtEndDate.SetFocus
Else
ValidDataT = True
End If
If Not ValidDataT Then
MsgBox strMessage, vbOKOnly
End If
End Function
Private Sub cmbsearch_Click()
rsFILTER
End Sub
Private Sub Combo1_Change()
End Sub
Private Sub Combo2_Click()
txtSex.Text = Combo2.Text
Combo2.Visible = False
End Sub
Private Sub Command1_Click()
Frame1.Visible = True
End Sub
Private Sub Command2_Click()
Frame3.Visible = False
Option1.Value = True
End Sub
Private Sub Command3_Click()
If Guest = "old" Then
check_RStemp
rstemp.Open "select * from guest", Cnn
'Cnn.Execute "INSERT INTO guest (guest_id, last_name, first_name, mi, address, age, sex, nationality, tel_no, company) VALUES (" & lblGC.Caption & ", '" & txtLN.Text & _
'"', '" & txtFN.Text & "', '" & txtMI.Text & "', '" & txtAddress.Text & "', '" & txtAge.Text & "', '" & txtSex.Text & "', '" & txtNationality.Text & "', '" & txtTelNo.Text & _
'"', '" & txtCompany.Text & "')" '
'check_RS2
'rs2.Open "select * from room_transaction", Cnn
'Cnn.Execute "insert into room_transaction (room_trans_no,room_trans_date,guest_id,total_charges) values (" & T & ", '" & datelbl.Caption & _
'"', '" & lblGuestCode.Caption & "', '" & lblCharges.Caption & "')"
'=================
'check_RS1
'rs1.Open "select * from payment_deposit", Cnn
'Cnn.Execute "INSERT INTO payment_deposit (OR_no, trans_code, trans_no, date_paid, total) VALUES (" & Label12.Caption & ", '" & Label18.Caption & _
'"', '" & T & "', '" & datelbl.Caption & "', '" & lblTotal.Caption & "')" '
'=================
'Cnn.Execute "update archive set total = " & lblTotal.Caption & " where room_trans_no = " & T
rs1.Requery 1
Unload Me
ElseIf Guest = "new" Then
check_RStemp
rstemp.Open "select * from guest", Cnn
Cnn.Execute "INSERT INTO guest (guest_id, last_name, first_name, mi, address, age, sex, nationality, tel_no, company) VALUES (" & lblGC.Caption & ", '" & txtLN.Text & _
"', '" & txtFN.Text & "', '" & txtMI.Text & "', '" & txtAddress.Text & "', '" & txtAge.Text & "', '" & txtSex.Text & "', '" & txtNationality.Text & "', '" & txtTelNo.Text & _
"', '" & txtCompany.Text & "')" '
'===============
'check_RS2
'rs2.Open "select * from room_transaction", Cnn
'Cnn.Execute "insert into room_transaction (room_trans_no,room_trans_date,guest_id,total_charges) values (" & T & ", '" & datelbl.Caption & _
'"', '" & lblGC.Caption & "', '" & lblCharges.Caption & "')"
'=================
'check_RS1
'rs1.Open "select * from payment", Cnn
'Cnn.Execute "INSERT INTO payment (OR_no, trans_code, trans_no, date_paid, total) VALUES (" & Label12.Caption & ", '" & Label18.Caption & _
'"', '" & T & "', '" & datelbl.Caption & "', '" & lblTotal.Caption & "')" '
'=================
'Cnn.Execute "update archive set total = " & lblTotal.Caption & " where room_trans_no = " & T
rs1.Requery 1
Unload Me
End If
End Sub
Private Sub Command4_Click()
Guest = "old"
Frame3.Visible = True
End Sub
Private Sub DTPicker1_Change()
If DTPicker1.Value < Date Then
MsgBox "Date must be higher than date today...", vbInformation, "IIS-CVH"
txtEndDate = ""
Else
txtEndDate.Text = DTPicker1.Value
End If
End Sub
Private Sub Form_Load()
DTPicker1.Value = Date
TransType = "Room Transaction"
TotalAmount = 0
datenow = Format(Date, "mmdd")
Status = "OCCUPIED"
check_RS
rs.Open "select * from room order by room_no asc", Cnn
fill
'=============
G = 10000
check_RStemp
rstemp.Open "select * from guest", Cnn
'=============
While Not rstemp.RecordCount = 0
check_RStemp
G = G + 1
rstemp.Open "select * from guest where guest_id = " & G, Cnn
Wend
lblGuestCode = G
lblGC = G
'=============
'T = 1
On Error GoTo r
check_RS1
rs1.Open "select * from archive order by room_trans_no desc", Cnn
If rs1.BOF = True And rs1.EOF = True Then
End If
rs1.MoveFirst
lblTransCode.Caption = rs1!room_trans_no
Label23.Caption = "Transaction No." & rs1!room_trans_no + 1
r:
'=============
check_RS2
rs2.Open "select * from payment", Cnn
'=============
check_RS
rs.Open "select * from guest", Cnn
fillg
'=============
check_RS
rs.Open "select * from transaction_type", Cnn
While Not rs.EOF
If TransType = rs!Description Then
Label18.Caption = rs!trans_code
rs.MoveLast
rs.MoveNext
Else
rs.MoveNext
End If
Wend
'=============
Option1.Value = True
lbldate.Caption = Date
datelbl.Caption = Date
lblOCDate.Caption = Date
Frame3.Visible = False
Combo2.Visible = False
Guest = "new"
Label12 = datenow & T & Label18
Command3.Enabled = False
Command4.Visible = False
End Sub
Public Sub fill()
Dim x As Integer
lvroom.ListItems.Clear
While Not rs.EOF
Set lst = lvroom.ListItems.Add(, , rs(0), , 1)
For x = 1 To 2
lst.SubItems(x) = rs(x)
If rs.Fields(3) = "OCCUPIED" Then lst.SubItems(1) = "OCCUPIED"
Next x
rs.MoveNext
Wend
End Sub
Public Sub filll()
check_RS
rs.Open "select * from room order by room_no asc", Cnn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -