【正文】
amp。 % B = B + D = 100 + A = B + 200 補(bǔ)交日期: amp。 : amp。 B = B + D = 100 + A = B + 200 押金: amp。 B = B + D (A, B + 100)(C, B + 100) = 100 + A = B + 200 姓名: amp。 Time amp。打印住宿登記單據(jù) = 8000: = 8000 = 1100: = 300 = 12 望月賓館 (住宿證) Dim A, B, C, D As Integer A = 100: B = 500: C = 4800: D = 400 = 10 = 100 + A = B + 200 Date amp。PrinterNewPage打印新的一頁(yè);;;, ;。取消操作 For i = 0 To 11 ZSDJ(i).Enabled = False Next i = False: = False: = False = False: = False: = False: = False = False: = False: = TrueEnd Sub使用Printer對(duì)象打印住宿登記單。更新房間狀態(tài) 房間號(hào) like + Chr(34) + + Chr(34) + (房態(tài)) = 入住 39。 Left(Right(Time, 5), 2) (標(biāo)志) = 1 39。 Right(Date, 2) amp。(BZ) = Left(Date, 4) amp。更新記錄 39。 Left(Time, 2) amp。 Right(Left(Date, 7), 2) amp。添加住宿信息 If Then (憑證號(hào)碼) = If ZSDJ(0).Text Then (姓名) = ZSDJ(0).Text If Then (證件名稱) = If ZSDJ(1).Text Then (證件號(hào)碼) = ZSDJ(1).Text If ZSDJ(2).Text Then (詳細(xì)地址) = ZSDJ(2).Text If ZSDJ(3).Text Then (出差事由) = ZSDJ(3).Text If Then (房間號(hào)) = Val() If ZSDJ(4).Text Then (客房類型) = ZSDJ(4).Text If Then (住宿日期) = If Then (住宿時(shí)間) = If ZSDJ(5).Text Then (客房?jī)r(jià)格) = Val(ZSDJ(5).Text) If ZSDJ(6).Text Then (住宿天數(shù)) = ZSDJ(6).Text If ZSDJ(8).Text Then (折扣) = ZSDJ(8).Text If ZSDJ(7).Text Then (宿費(fèi)) = ZSDJ(7).Text If Then (結(jié)款方式) = If ZSDJ(9).Text Then (應(yīng)收宿費(fèi)) = ZSDJ(9).Text If ZSDJ(10).Text Then (預(yù)收金額) = Val(ZSDJ(10).Text) If Then (提醒日期) = If Then (提醒時(shí)間) = If Then (退宿日期) = If Then (退宿時(shí)間) = If ZSDJ(11).Text Then (備注) = ZSDJ(11).Text (日期) = Date (時(shí)間) = Time 39。代碼如下:Private Sub ok_Click() Dim mydb1 As Database Dim myrs1 As Recordset Set mydb1 = Workspaces(0).OpenDatabase( amp。設(shè)置控件有效或無(wú)效 = True: = False: = False: ZSDJ(8).Enabled = True ZSDJ(10).Enabled = True: ZSDJ(11).Enabled = True: = True: = True = True: ZSDJ(0).SetFocus 39。 Format(1, 000) End IfEnd If39。 Format(Val(Right(, 3)) + 1, 000) End If If Then = Date amp。 Format(1, 000)If Then = Month(Date) = Month(Left(, 10)) If = Then = Date amp。生成憑證號(hào)碼 = select * from djb order by 憑證號(hào)碼If Not Then If = Then = Date amp??辗?9??辗?9。具體代碼如下:Private Sub dj_Click()39。、三位數(shù)字編碼組成。ZSDJ(5)獲得焦點(diǎn)End Sub 單擊“登記”按鈕,將自動(dòng)生成憑證號(hào)碼。賦值給ZSDJ(4) ZSDJ(5).Text = (價(jià)格) 39。39。and 標(biāo)志=39。 amp。查詢空閑房間信息 = select * from djb where 房間號(hào)=39??辗?9。 39。 amp。按回車鍵DTP3獲得焦點(diǎn)End SubPrivate Sub tim4_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then 39。按回車鍵tim3獲得焦點(diǎn)End SubPrivate Sub DTP3_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then 39。按回車鍵Comok獲得焦點(diǎn) End SelectEnd SubPrivate Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then ZSDJ(1).SetFocus 39。按回車鍵ZSDJ(6)獲得焦點(diǎn) Case 6 If KeyCode = vbKeyReturn Then ZSDJ(10).SetFocus Case 8 If KeyCode = vbKeyReturn Then ZSDJ(10).SetFocus’回車鍵ZSDJ(10)獲得焦點(diǎn) Case 10 If KeyCode = vbKeyReturn Then ZSDJ(11).SetFocus 39。按回車鍵ZSDJ(2)獲得焦點(diǎn) Case 4 If KeyCode = vbKeyReturn Then ZSDJ(5).SetFocus 39。按回車鍵ZSDJ(2)獲得焦點(diǎn) Case 2 If KeyCode = vbKeyReturn Then ZSDJ(3).SetFocus 39。計(jì)算提醒日期 If (Val(ZSDJ(10).Text) Int(Val(ZSDJ(10).Text) / Val(ZSDJ(5).Text))) * Val(ZSDJ(5).Text) Then = 6:00:00 PM Else = 12:00:00 AM End If End If End SelectEnd SubPrivate Sub ZSDJ_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) Select Case Index Case 0 If KeyCode = vbKeyReturn Then 39。計(jì)算實(shí)際宿費(fèi) Case 10 If ZSDJ(10).Text Then ZSDJ(10).Text = Val(ZSDJ(10).Text) 39。賦值給ZSDJ(9) ZSDJ(8).Text = 100 = + Val(ZSDJ(6).Text) 39。賦值給ZSDJ(8) End IfEnd SubPrivate Sub ZSDJ_Change(Index As Integer) Select Case Index Case 6 ZSDJ(7).Text = Format(Val(ZSDJ(6).Text) * Val(ZSDJ(5).Text), ) 39。ZSDJ(8)獲得焦點(diǎn) End If If = 招待 Then ZSDJ(8).Enabled = True 39。設(shè)置主窗體有效End SubPrivate Sub Combo2_Click() If = 折扣 Then ZSDJ(8).Enabled = True 39。賦值給czy 39。 \End SubPrivate Sub Form_Activate() = Date: = Time39。 \ = amp。定義一個(gè)整型變量Private Sub Form_Load() 39。主要控件對(duì)象的屬性如表3-10所示。 圖35“住宿登記”界面 2.實(shí)現(xiàn)過(guò)程 ⑴在“客房管理系統(tǒng)”工程中,添加一個(gè)新窗體,命名為main_kfdj。 .打印住宿登記單據(jù)。 .實(shí)現(xiàn)客人住宿登記,收取客人預(yù)交宿費(fèi)。在住宿登記模塊中主要實(shí)現(xiàn)如下功能: .自動(dòng)生成住宿登記憑證號(hào)碼。 If And And = (密碼) Then Load main Unload Me Else If TIM = 3 Then 39。 amp。驗(yàn)證操作員及密碼 If = False Then 操作員 like + Chr(34) + + Chr(34) + If Then MsgBox (操作員輸入錯(cuò)誤!) Else = select * from qxsz where 操作員=39。按回車鍵,text2獲得焦點(diǎn)End SubPrivate Sub text2_KeyDown(KeyCode As Integer, Shift As Integer)If KeyCode = vbKeyReturn Then 39。 \End SubPrivate Sub Form_Activate()39。自動(dòng)識(shí)別數(shù)據(jù)庫(kù)路徑 = amp。定義一個(gè)整型變量Dim myval As String 39。主要控件對(duì)象的屬性如表3一9所示。b、單擊“工程”菜單下的“部件”選項(xiàng),在彈出的列表中,選定“Microsoft Dat BoundList Control 6.0”選項(xiàng),然后單擊“確定”按鈕,DBCombo控件將被添加到工具箱中。 系統(tǒng)登錄界面如圖34所示。 .操作員錯(cuò)誤或密碼錯(cuò)誤提醒并返回錯(cuò)誤點(diǎn)。在系統(tǒng)登錄模塊中主要實(shí)現(xiàn)如下功能: .可選擇操作員,支持鼠標(biāo)和鍵盤操作。調(diào)入初始化 = FalseEnd SubPrivate Sub qxsz_Click() 39。調(diào)入操作員設(shè)置 Load main_czysz = FalseEnd SubPrivate Sub ma_Click() 39。調(diào)入客房銷售報(bào)表 = FalseEnd SubPrivate Sub xstj_Click() 39。調(diào)入宿費(fèi)提醒 Load main_xftx = FalseEnd SubPrivate Sub ysbb_Click() 39。調(diào)入住宿查詢 Load main_zscx = FalseEnd SubPrivate Sub tfcx_Click() 39。調(diào)入客戶結(jié)款 Load main_khjk = FalseEnd SubPrivate Sub ydfcx_Click() 39。調(diào)入房態(tài)查看 = FalseEnd SubPrivate Sub gzcx_Click() 39。調(diào)入客房管理 = FalseEnd SubPrivate Sub kfcx_Click() 39。調(diào)入調(diào)房登記 = FalseEnd SubPrivate Sub tf_Click() 39。調(diào)入住宿登記 = FalseEnd SubPrivate Sub zjyj_Click() 3