【正文】
”Then Select Case intCount Case 0 sMeg=“客房編號” Case 1 sMeg=“客房種類” Case 2 sMeg=“客房位置” Case 3 sMeg=“客房單價” End Select sMeg=sMegamp?!安荒転榭?!” MsgBox sMeg,vbOKOnly+vbExclamation,“警告” cboItem(intCount).SetFocus Exit Sub End If Next intCount If IsDate(txtItem(2)) Then txtItem(2)=Format(txtItem(2),”yyyymmdd”) Else MsgBox “入庫時間應輸入日期(yyyymmdd)!”,vbOKOnly+vbExclamation,”警告” txtItem(2).SetFocus Exit Sub End If For intCount=1 To 3 Step 2 If Not IsNumeric(txtItem(intCount)) Then MsgBox “請輸入數(shù)字”,vbOKOnly+vbExclamation,“警告” txtItem(intCount).SetFocus Exit Sub End If Next intCount If gintBmode =2 Then txtSQL=”delete from booking where bookno=’”amp。Trim(txtNo)amp?!薄?Set mrcc=ExecuteSQL(txtSQL,MsgText) End If txtSQL=”select*from booking” Set mrcc=ExecuteSQL(txtSQL,MsgText) (0)=txtNO For intCount=0 To 1 (intCount+1)=txtItem(intText) Next intCount (3)=cboItem(0) For intCount=2 To 4 (intCount+2)=txtItem(intCount) Next intCount (8)=0 txtSQL=”select*from rooms where roomNO=’”amp。Trim(vboItem(0))amp?!薄?Set mrcc=ExecuteSQL(txtSQL,MsgText) If Not Then mrcc!putup=”y” End If If gintBmode=1 Then MsgBox “添加訂房信息成功!”,vbOKOnly+vbExclamation,“添加訂房消息” Unload Me If flagBedit Then Unload frmBookin End If =”select bookno,customname,customID,roomno,indate,discount,inmemo from booking where amount=’0’” Else MsgBox“修改訂房信息成功!”,vbOKOnly+vbExclamation,“修改訂房信息” Unload Me If flagBedit Then Unload frmBookin End If =”select bookno,customname,customID,roomno,indate,discount,inmemo from booking where amount =’0’” End If End Sub ⑺結算信息管理模塊的創(chuàng)建結算信息管理模塊主要實現(xiàn)如下功能:添加結算信息修改結算信息查詢結算信息具體實現(xiàn)代碼如下:Private Sub From_Load()‘窗體載入時,自動加入所有未結算客房信息 Dim sSql As String Dim intCount As Integer Dim MsgText As String If gintCmode=1 Then ‘判斷是否處于添加狀態(tài) =amp。“添加” txtSQL=”select DISTINCT roomno from booking where amount=’0’”‘初始化客房編號,選擇所有未結算客房編號 Set mrc=ExecuteSQL(txtSQL,MsgText) If Not Then Do While Not cboItem(0).AddItem Trim(mrc!roomno) Loop Else MsgBox “沒有顧客入住!”,vbOKOnly+vbExclamation,“警告” =False Exit Sub End If ElseIf gintCmode=2 Then‘判斷是否處于修改狀態(tài) Set mrc=ExecuteSQL(txtSQL,MsgText) If =False Then With mrc txtNo =(0) For intCount=0 To 1 txtItem(intCount)=.Fields(intCount+1) Next intCount cboItem(0).(3) cboItem(0).ListIndex=0 For intCount=2 To 3 If Not IsNull(.Fields(intCount+2)) Then txtItem(intCount)=.Fields(intCount+2) +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ End If Next intCount txtItem(5)=.Fields(6) txtItem(4)=.Fields(7) End With End If txtSQL=”select*from rooms where roomNO=’”amp。cboItem(0)amp。”’” Set mrc=ExecuteSQL(txtSQL,MsgText) If =False Then With mrc For intCount=1 To 3 cboItem(intCount).(intCount) cboItem(intCount).ListIndex=0 Next intCount End With End If For intCount =0 To 3 txtItem(intCount).Enabled=False Next intCount =amp?!靶薷摹?End If mblChange=FalseEnd SubPrivate Sub cboItem_Click(Index As Integer)‘選擇不同客房,觸發(fā)cboItem下拉式文本框的click事件,顯示相應的顧客信息 Dim sSql As String Dim MsgText String Dim mrcc As Dim intCount As Integer If gintCmode =1 Then ‘判斷是否處于添加狀態(tài),否則將退出 If Index=0 Then cboItem(1).Enabled=True cboItem(2).Enabled=True cboItem(3).Enabled=True cboItem(1).Clear‘清除原有內容 cboItem(2).Clear cboItem(3).Clear txtSQL=”select roomNO,roomtype,roomposition,roomprice from where roomNo =’”amp。Trim(cboItem(0))amp?!薄?‘顯示有關客房的具體信息 Set mrcc=ExecuteSQL(txtSQL,MsgText) If Not Then cboItem(1).AddItem mrcc!roomtype cboItem(2).AddItem mrcc!roomposition cboItem(3).AddItem mrcc!roomprice cboItem(1).Enabled=False cboItem(2).Enabled=False cboItem(3).Enabled=False cboItem(1).ListIndex=0 cboItem(2).ListIndex=0 cboItem(3).ListIndex=0 =True Else MsgBox “沒有訂房信息!”,vbOKOnly+vbExclamation, “警告” =False Exit Sub End If txtSQl=”select*from booking where amount=’0’and roomno=’”amp。Trim(cboItem(0))amp。”’”‘顯示相關顧客信息 Set mrcc=ExecuteSQL(txtSQL,MsgText) If Not Then txtNO=mrcc!bookno txtItem(0)=mrcc!customname txtItem(1)=mrcc!customID +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ txtItem(2)=mrcc!indate txtItem(3)=mrcc!discount txtItem(5)=mrcc!inmemo For intCount =0 To 3 txtItem(intCount).Enabled=False Next intCount End If End If End If Exit SubEnd SubPrivte Sub cmdSave_Click() Dim intCount As Integer Dim sMeg As String