【文章內(nèi)容簡介】
ox sMeg, vbOKOnly + vbExclamation, 警告 = Exit Sub End If If Trim() = Then sMeg = 主客姓名 sMeg = sMeg amp。 不能為空! MsgBox sMeg, vbOKOnly + vbExclamation, 警告 Exit Sub End If With DbCommand .CommandType = adCmdText .CommandText=insert into bill (bill,master,sex,certificate,certify_code,birthday,phone,address,unit,mastercode,guesttype,rebate,guestsum,male,female,shoes,start,willleave,housesum,deposit,confirmpeople,alreadypaid,remark,inputer,warning,cardid,forother,forwhose) Set DbTempSet = .Execute sMeg = 你的輸入信息已經(jīng)保存成功 MsgBox sMeg, vbOKOnly + vbExclamation, 提示 End WithErrp: MsgBox , vbOKOnly, End SubPrivate Sub Form_Load() On Error GoTo Errp: = 1400 = 2000 身份證 工作證 學(xué)生證 警官證 駕駛證 居住證 公務(wù)員 學(xué) 生 工 人 教 師 農(nóng) 民 軍 人 警 察 團(tuán)體 個(gè)人 男 女 是 否Errp: MsgBox , vbOKOnly, End Sub打開主界面的“客房管理”,選擇“客房信息查詢”目的就是對房間的編號(hào)、房間的類型、樓層、預(yù)定情況就行查詢。選中房間編號(hào),單擊查詢界面會(huì)出現(xiàn)相關(guān)的數(shù)據(jù),依次類推。最后單擊退出按鈕回到主界面?!犊头啃畔⒉樵儭反a如下:Private Sub Commandfresh_Click() Call Commandquery_ClickEnd SubPrivate Sub Commandquery_Click()Dim StrSql As StringDim StrCon As StringDim i As IntegerDim bianhao As StringDim loucheng As StringDim roomleixing As StringDim ordercondition As StringOn Error GoTo Errp: Call BuildTitle If = True Then bianhao = Trim() StrSql = select roomcode,roomtype,floor,phone,roomstutus,reserved,reservetime,freetime,remark,selected,cleaned FROM roomstate where roomcode = 39。 + bianhao + 39。 End If If = True Then loucheng = Mid(Trim(), 1, 1) StrSql = select roomcode,roomtype,floor,phone,roomstutus,reserved,reservetime,freetime,remark,selected,cleane FROM roomstate where floor = 39。 + loucheng + 39。 End If If = True Then roomleixing = Trim() StrSql=select roomcode,roomtype,floor,phone,roomstutus,reserved,reservetime,freetime,remark,selected,cleane FROM roomstate where roomtype = 39。 + roomleixing + 39。 End If If = True Then ordercondition = Trim() StrSql = select roomcode,roomtype,floor,phone,roomstutus,reserved,reservetime,freetime,remark,selected,cleane FROM roomstate where reserved = 39。 + ordercondition + 39。 End If With DbCommand .CommandText = StrSql Set DbTempSet = .Execute End With With Xsheet .Rows = 1 Do While Not .Rows = .Rows + 1 For i = 1 To .TextMatrix(.Rows 1, i 1) = (i 1) Next i Loop End With Exit SubErrp:MsgBox , vbOKOnly, End SubPrivate Sub Commandexit_Click() Unload MeEnd SubPrivate Sub Form_Load()On Error GoTo Errp: Call BuildTitle 39。建立表頭 With DbCommand .CommandType = adCmdText .CommandText = Select roomcode from roomstate Set DbTempSet = .Execute End With If Not ( And ) Then With DbTempSet .MoveFirst While Not .EOF With PosCbo .AddItem (LTrim(RTrim(DbTempSet!roomcode))) End With .MoveNext Wend End With = 0 Else MsgBox 沒有按此編號(hào)的客房!, vbOKOnly, End If With DbCommand .CommandText = Select roomtype from roomstate Set DbTempSet = .Execute End With If Not ( And ) Then While Not (LTrim(RTrim(DbTempSet!roomtype))) Wend = 0 Else MsgBox 沒有此種客房類型!, vbOKOnly, End If With DbCommand .CommandText = Select floor from roomstate Set DbTempSet = .Execute End With If Not ( And ) Then While Not (LTrim(RTrim(DbTempSet!floor))) + 樓 Wend = 0 Else MsgBox 此樓沒有客房!, vbOKOnly, End If With DbCommand .CommandText = Select reserved from roomstate Set DbTempSet = .Execute End With If Not ( And ) Then While Not (LTrim(RTrim(DbTempSet!Reserved))) Wend = 0 Else MsgBox 是否已經(jīng)預(yù)訂!, vbOKOnly, End If Exit SubErrp: MsgBox , vbOKOnly, End SubPrivate Sub BuildTitle()On Error GoTo Errp: With Xsheet .CellAlignment = flexAlignCenterCenter .Cols = 11 .TextMatrix(0, 0) = 房間號(hào)碼 .TextMatrix(0, 1) = 房間類型 .TextMatrix(0, 2) = 所屬樓層 .TextMatrix(0, 3) = 電話分機(jī) .TextMatrix(0, 4) = 目前狀態(tài) .TextMatrix(0, 5) = 是否預(yù)訂 .TextMatrix(0, 6) = 預(yù)訂時(shí)間 .TextMatrix(0, 7) = 空房時(shí)間 .TextMatrix(0, 8) = 備 注 .TextMatrix(0, 9) = 已經(jīng)選中 .TextMatrix(0, 10) = 已經(jīng)清掃 CellAlignment = flexAlignCenterCenter .ColWidth(0) = 900 .CellAlignment = flexAlignCenterCenter .ColWidth(1) = 800 .CellAlignment = flexAlignCenterCenter .ColWidth(2) = 1000 .CellAlignment = flexAlignCenterCenter .ColWidth(3) = 1000 .CellAlignment = flexAlignCenterCenter .ColWidth(4) = 1000 .CellAlignment = flexAlignCenterCenter .ColWidth(5) = 1000 .CellAlignment = flexAlignCenterCenter .ColWidth(6) = 1500 .CellAlignment = flexAlignCenterCenter .ColWidth(7) = 1200 .CellAlignment = flexAlignCenterCenter .ColWidth(8) = 1300 .CellAlignment = flexAlignCenterCenter .ColWidth(9) = 1100 .CellAlignment = flexAlignCenterCenter .ColWidth(10) = 1200 End WithErrp: MsgBox , vbOKOnly, End SubPrivate Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)End Sub打開主界面的“客房管理”,選擇“房型房價(jià)查詢”目的就是對房型名稱、普通價(jià)格查詢、床位數(shù)來進(jìn)行查詢。最后,單