?? 客人列表查詢.frm
字號:
Dim Data_Rec As Long
Dim TY_XG As Boolean
Dim FB_table1 As String
Private Sub Command1_Click()
Adodc1.Recordset.Fields("級別") = "黑名單"
Adodc1.Recordset.Fields("級別類型") = Me.Combo10.Text
Adodc1.Recordset.Update
End Sub
Private Sub Command10_Click()
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("姓名") = KeRen.Text
Adodc1.Recordset.Fields("英文姓名") = Text2.Text
Adodc1.Recordset.Fields("性別") = Combo1.Text
Adodc1.Recordset.Fields("出生日期") = Text4.Text
Adodc1.Recordset.Fields("籍貫") = Text5.Text
Adodc1.Recordset.Fields("長住地址") = Text6.Text
Adodc1.Recordset.Fields("聯(lián)系電話") = Text7.Text
Adodc1.Recordset.Fields("身份或職業(yè)") = Text8.Text
Adodc1.Recordset.Fields("證件號碼") = Text9.Text
Adodc1.Recordset.Fields("類別") = Combo2.Text
Adodc1.Recordset.Fields("級別") = Text11.Text
Adodc1.Recordset.Fields("密碼") = Text12.Text
Adodc1.Recordset.Fields("折扣") = Text13.Text
Adodc1.Recordset.Update
Me.Picture5.Visible = False
End Sub
Private Sub Command11_Click()
Me.Picture5.Visible = False
End Sub
Private Sub Command2_Click()
Me.Picture2.Visible = False
End Sub
Private Sub Command4_Click()
On Error GoTo ERR_pro201
Picture1.Visible = False
If Me.Option1.Value Then
ZH_ysh = " like "
End If
If Me.Option2.Value Then
ZH_ysh = " >= "
End If
If Me.Option3.Value Then
ZH_ysh = " <= "
End If
If Me.Option4.Value Then
ZH_ysh = " = "
End If
If Me.Option5.Value Then
ZH_ysh = " <> "
End If
If Me.Option6.Value Then
ZH_ysh = " like "
End If
Field_Value = Field_Z.Text
'MsgBox Field_Type
If Field_Value <> "" Then
If Field_Value = "null" Or field_valu = "NULL" Then
If ZH_find1 = "" Then
'空值,單級
'ZH_find1 = FindFieldC & " like " & "'" & Field_Value & "'"
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find1 = " not " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find1 = " not " & FindFieldC & " is null"
Else
If Field_Type = 200 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 202 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 7 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 135 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 2 Then ZH_find1 = FindFieldC & " is null"
If Field_Type = 6 Then ZH_find1 = FindFieldC & " is null"
End If
Else
'空值,多級
'ZH_find1 = ZH_find1 & " and " & FindFieldC & " like " & "'" & Field_Value & "'"
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And not " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
Else
If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
End If
End If
Else
If ZH_find1 = "" Then
'非空值,單級
'ZH_find1 = FindFieldC & " like " & "'" & Field_Value & "'"
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
If Field_Type = 202 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
If Field_Type = 7 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
If Field_Type = 135 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
If Field_Type = 2 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
If Field_Type = 6 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
Else
If Field_Type = 200 Then ZH_find1 = FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 202 Then ZH_find1 = FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 7 Then ZH_find1 = FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 135 Then ZH_find1 = FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 2 Then ZH_find1 = FindFieldC & ZH_ysh & CInt(Field_Value)
If Field_Type = 6 Then ZH_find1 = FindFieldC & ZH_ysh & CInt(Field_Value)
End If
Else
'非空值,多級
'ZH_find1 = ZH_find1 & " and " & FindFieldC & " like " & "'" & Field_Value & "'"
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And (not " & FindFieldC & ZH_ysh & " '" & Field_Value & "' or " & FindFieldC & " is null)"
If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
Else
If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And " & FindFieldC & ZH_ysh & " '" & Field_Value & "'"
If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & CInt(Field_Value)
If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & CInt(Field_Value)
End If
End If
End If
'多級與單級分類
If DJ_query Then
ZH_find = " where " & ZH_find1
Else
'ZH_find = " where " & FindFieldC & " like " & "'" & Field_Value & "'"
If Field_Value = "null" Or field_valu = "NULL" Then
'空值
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find = " where not " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find = " where not " & FindFieldC & " is null"
Else
If Field_Type = 200 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find = " where " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find = " where " & FindFieldC & " is null"
End If
Else
If Me.Option6.Value Then
If Field_Type = 200 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null"
If Field_Type = 202 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null"
If Field_Type = 7 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null"
If Field_Type = 135 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null"
If Field_Type = 2 Then ZH_find = " where not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null"
If Field_Type = 6 Then ZH_find = " where not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null"
Else
If Field_Type = 200 Then ZH_find = " where " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 202 Then ZH_find = " where " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
If Field_Type = 7 Then ZH_find = " where " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 135 Then ZH_find = " where " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
If Field_Type = 2 Then ZH_find = " where " & FindFieldC & ZH_ysh & CInt(Field_Value)
If Field_Type = 6 Then ZH_find = " where " & FindFieldC & ZH_ysh & CInt(Field_Value)
End If
End If
End If
'MsgBox ZH_find
FB_table2 = " 住宿情況 " & ZH_find & " order by " & Or_Field
US_Field = " 住宿情況 " & ZH_find
'MsgBox FB_table2
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from " & FB_table2
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.ReBind
DataGrid1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "請注意:你所查找的用戶不存在,請核對!", vbOKOnly, "錯誤信息"
End If
End If
Exit Sub
ERR_pro201:
MsgBox "請注意:查詢錯誤,重新操作!", 48, "提示"
End Sub
Private Sub Command5_Click()
Picture1.Visible = False
End Sub
Private Sub Command7_Click()
Load_Statu = "使用"
房態(tài)圖FORM.Show 1
If Room_Update Then
Me.F_RoomNo.Text = RoomNO
Me.F_RoomRate.Text = Room_Rate
End If
QAccount_ID = ""
End Sub
Private Sub Command8_Click()
Dim Qname As String
Dim Qaid As String
Qname = Adodc1.Recordset.Fields("姓名")
Qaid = Adodc1.Recordset.Fields("帳號")
If Room_Statu = "空房" Then
If Load_Statu = "使用" Then
Adodc9.ConnectionString = My_PROVIDER
Adodc9.CommandType = adCmdText
Adodc9.RecordSource = "select * from 客房 where 房號 like '" & F_RoomNo & "'"
Adodc9.Refresh
Adodc9.Recordset.Fields("當(dāng)前狀態(tài)") = "售出"
Adodc9.Recordset.Fields("出售方式") = Room_Use_Type
Adodc9.Recordset.Fields("帳號") = Account_ID
Adodc9.Recordset.Fields("住客") = 1
Adodc9.Recordset.Update
Adodc9.Recordset.Close
End If
Else
If Room_Statu = "預(yù)訂" Then
If Account_ID = QAccount_ID Then
Adodc9.ConnectionString = My_PROVIDER
Adodc9.CommandType = adCmdText
Adodc9.RecordSource = "select * from 客房 where 房號 like '" & F_RoomNo & "'"
Adodc9.Refresh
Adodc9.Recordset.Fields("當(dāng)前狀態(tài)") = "售出"
Adodc9.Recordset.Fields("出售方式") = Room_Use_Type
Adodc9.Recordset.Fields("帳號") = Account_ID
Adodc9.Recordset.Update
Adodc9.Recordset.Close
Else
MsgBox "請注意:" & RoomNO & "房間當(dāng)前狀態(tài)是:[" & Room_Statu & "],被[" & QAccount_ID & "]帳號" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
Room_Update = False
End If
Else
If Room_Statu = "售出" Then
Select Case Room_Share_Type
Case "共享"
MsgBox "請注意:" & RoomNO & "房間當(dāng)前狀態(tài)是:[" & Room_Statu & "],被[" & QAccount_ID & "]帳號" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
Case "包房"
MsgBox "請注意:" & RoomNO & "房間當(dāng)前狀態(tài)是:[" & Room_Statu & "],被[" & QAccount_ID & "]帳號" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
Case Else
MsgBox "房間狀態(tài)錯誤,請核查!", 64, "提示"
End Select
End If
End If
End If
Adodc9.ConnectionString = My_PROVIDER
Adodc9.CommandType = adCmdText
Adodc9.RecordSource = "select * from 客房 where 房號 like '" & Text1 & "'"
Adodc9.Refresh
If Adodc9.Recordset.RecordCount > 0 Then
Adodc9.Recordset.Fields("當(dāng)前狀態(tài)") = "臟房"
Adodc9.Recordset.Fields("出售方式") = ""
Adodc9.Recordset.Fields("帳號") = ""
Adodc9.Recordset.Fields("住客") = Adodc9.Recordset.Fields("住客") - 1
Adodc9.Recordset.Update
End If
Adodc9.Recordset.Close
Adodc2.ConnectionString = My_PROVIDER
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select * from 房號變更表"
Adodc2.Refresh
Adodc2.Recordset.AddNew
Adodc2.Recordset.Fields("日期") = System_Date
Adodc2.Recordset.Fields("時間") = Left(Time, 5)
Adodc2.Recordset.Fields("帳號") = Qaid
Adodc2.Recordset.Fields("姓名") = Qname
Adodc2.Recordset.Fields("原房號") = Me.Text1.Text
Adodc2.Recordset.Fields("現(xiàn)房號") = Me.F_RoomNo.Text
Adodc2.Recordset.Fields("操作員") = CzyName
Adodc2.Recordset.Update
Adodc2.Recordset.Close
'MsgBox Me.F_RoomNo.Text
Adodc1.Recordset.Fields("房號") = Me.F_RoomNo.Text
Adodc1.Recordset.Fields("房價") = CCur(Me.F_RoomRate.Text)
Adodc1.Recordset.Fields("房類") = Room_Type
Adodc1.Recordset.Update
Me.Picture3.Visible = False
MsgBox "換房成功!", 64, "提示"
End Sub
Private Sub Command9_Click()
Me.Picture3.Visible = False
End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
On Error GoTo errhandler
FindFieldC = Adodc1.Recordset.Fields(DataGrid1.Col).Name
Field_Type = CInt(Adodc1.Recordset.Fields(DataGrid1.Col).Type)
'MsgBox Adodc1.Recordset.Fields(DataGrid1.Col).DefinedSize
If InStr(1, Adodc1.RecordSource, "住宿情況") > 0 Then
Select Case Me.Caption
Case "在住客人預(yù)付和消費表"
'BB_type = "報表"
Case Else
Account_ID = Adodc1.Recordset.Fields("帳號")
QAccount_ID = Adodc1.Re
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -