【正文】
txtItem(intCount)=.Fields(intCount+1) End If Next intCount cboItem(0).AddItem !roomno cboItem(0).ListIndex=0 For intCount=2 To 4 If Not IsNull(.Fields(intCount+2)) Then txtItem(intCount)=.Fields(intCount+2) End If Next intCount End With End If =amp?!?修改 ” txtSQL=”select*from rooms where roomNO=’”amp。Trim(cboItem(0))amp?!薄? Set mrc=ExecuteSQL(txtSQL,MsgText) If Not Then For intCount=1 To 3 cboItem(intCount).AddItem (intCount) cboItem(intCount).ListIndex=0 Next intCount txtItem(5)=(5) End If End If End If mblChange=False End Sub Private Sub cmdSave_Click()‘ 添加記錄到數(shù)據(jù)庫中 Dim intCount As Integer Dim sMeg As String Dim mrcc As Dim MsgText As String For intCount=0 To 3‘ 判斷輸入內(nèi)容是否為空 If Trim(txtItem(intCount)amp?!薄?=”” Then Select Case intCount Case 0 sMeg=“ 顧客姓名 ” Case 1 sMeg=“ 身份證號(hào)碼 ” Case 2 sMeg=“ 折扣 ” Case 3 sMeg=“ 入住時(shí)間 ” End Select sMeg=sMegamp。“ 不能為空 !” MsgBox sMeg,vbOKOnly+vbExclamation,“ 警告 ” txtItem(intCount).SetFocus Exit Sub End If Next intCount For intCount=0 To 3 If Trim(vboItem(intCount)amp?!薄?=””Then Select Case intCount Case 0 sMeg=“ 客房編號(hào) ” Case 1 sMeg=“ 客房種類 ” Case 2 sMeg=“ 客房位置 ” Case 3 sMeg=“ 客房單價(jià) ” 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),”yyyy mmdd”) Else MsgBox “ 入 庫 時(shí) 間 應(yīng) 輸 入 日 期(yyyymmdd)!”,vbOKOnly+vbExclamation,” 警告 ” txtItem(2).SetFocus Exit Sub End If For intCount=1 To 3 Step 2 If Not IsNumeric(txtItem(intCount)) Then MsgBox “ 請(qǐng)輸入數(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 ⑺ 結(jié)算信息管理模塊的創(chuàng)建 結(jié)算信息管理模塊主要實(shí)現(xiàn)如下功能: ?添加結(jié)算信息 ?修改結(jié)算信息 ?查詢結(jié)算信息 具體實(shí)現(xiàn)代碼如下: Private Sub From_Load()‘ 窗體載入時(shí),自動(dòng)加入所有未結(jié)算客房信息 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’”‘ 初始化客房編號(hào),選擇所有未結(jié)算客房編號(hào) 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=False End Sub Private Sub cboItem_Click(Index As Integer)‘ 選擇不同客房,觸發(fā) cboItem下拉式文本框的 click事件,顯示相應(yīng)的顧客信息 Dim sSql As String Dim MsgText String Dim mrc