宾馆客房管理系统ER图.数据流图.功能模块图.流程图.目录第一章、系统概述1.1项目研究的意义第二章、系统需求分析2.1编写目的……………………………………………………………12.2开发背景……………………………………………………………22.3参考资料……………………………………………………………22.4任务概述2.4.1实现目标…………………………………………………………22.4.2运行环境…………………………………………………………32.3条件限制……………………………………………………………32.5数据描述2.5.1信息需求…………………………………………………………32.5.2处理需求…………………………………………………………32.6数据流图……………………………………………………………42.7数据字典……………………………………………………………62.8功能需求2.8.1功能模块…………………………………………………………62.8.2系统主要功能描述………………………………………………72.9性能需求2.9.1数据精度…………………………………………………………72.9.2时间特性…………………………………………………………72.10 运行需求 …………………………………………………………72.11 其他要求 …………………………………………………………7第三章、数据库概念结构设计3.1E-R图 ………………………………………………………………83.1.1 局部E-R图 ………………………………………………………83.1.2总E-R图 …………………………………………………………9第四章、数据库的逻辑结构设计(详细设计)4.1关系模式………………………………………………………………104.2基本表…………………………………………………………………104.3接口设计………………………………………………………………12第五章、系统的实现与调试5.1系统流程设计…………………………………………………………13第六章 系统的界面设计及源代码6.1登陆窗口界面及代码…………………………………………………146.2系统主窗口界面………………………………………………………156.3.住宿管理设计…………………………………………………………196.3.1住宿登记……………………………………………………………196.3.2追加押金……………………………………………………………256.3.3调房登记……………………………………………………………286.3.4退房结帐……………………………………………………………316.4客房管理………………………………………………………………366.4.1客房设置……………………………………………………………366.4.2.客房查询……………………………………………………………386.4.3.房态查看……………………………………………………………396.5挂帐管理………………………………………………………………416.6查询统计………………………………………………………………426.6.1.住宿查询……………………………………………………………426.6.2退宿查询……………………………………………………………426.6.3宿费提醒……………………………………………………………436.7日结设计………………………………………………………………446.7.1客房销售报表………………………………………………………446.8系统设置………………………………………………………………466.8.1操作员设置…………………………………………………………466.8.2密码设置……………………………………………………………476.8.3权限设置……………………………………………………………159
宾馆客房管理系统第一章 系统概论1.项目研究的意义随着我国经济的迅速发展,人们的生活水平有了显著的提高,假日经济和旅游经济已成为人们消费的热点。各地也把旅游业当作本地经济发展的重要经济支柱之一,从而促进了宾馆酒店业的快速发展。同时,随着宾馆酒店越来越多,人们的要求越来越高,宾馆酒店业的竞争也愈来愈激烈。如何在激烈的竞争中生从发展,是每一个宾馆酒店必须面临的问题。对宾馆的经营状况起决定作用的是宾馆的服务管理水平。如何利用先进的管理手段、提高宾馆的管理水平,以成为宾馆酒店业发展的当务之急。面对信息时代的机遇和挑战,利用科技手段提高企业管理水平是企业管理无疑的一条行之有效的途径。虽然计算机管理并不是宾馆管理走向成功的关键元素,但它可以最大限度地发挥准确、快捷、高效等作用,对宾馆的服务管理提供强有力的支持。因此,采用全新的计算机网络和宾馆管理系统,已成为提高宾馆的管理效率、改善服务的水准的重要手段之一。在某种意义上,宾馆客房管理方面的信息话已成为现代化宾馆的重要标志。第二章、系统需求分析2.1编写目的本文档对《宾馆客房管理系统》的开发需求进行描述,目的是明确宾馆管理系统对用户的功能要求,此说明书对《宾馆管理系统》做了全面细致的用户需求分析,明确所要开发的系统应有的功能、性能与界面,始有关人士能够清楚的了解用户的需求,并在此基础上进一步提出概要设计说明书和完成后续设计与开发工作。2.2开发背景随着人民生活水平的提高,旅游出行的人越来越多,宾馆的客流量不断增加,传统的宾馆管理方法已经不适应现代社会的需求。宾馆在正常运营中需要对客房资源、顾客信息、退房信息进行管理,利用客房管理系统及时了解各个环节中信息的变更,有利于提高管理的效率。 本项目作为<<数据库课程设计>>课程的训练项目提出,目的是为了提高同学们软件的开发和数据库的创建链接,以及软件文档的相关标准和编写原则,提高大家的实践能力.1)项目开发名称:宾馆客房管理系统2)项目的提出者:赵老师 3)项目的开发者:太原科技大学华科学院信息系 计算机052202H 秦芳芳
2.3参考资料书名 编著 出版社软件工程导论(第四版) 张海藩 清华大学出版社VB程序设计简明教程(第2版) 龚沛曾、陆慰民 高等教育出版社数据库系统概论(第四版) 王珊、萨师煊 高等教育出版社软件工程上机指导书 张国有 太原科技大学印刷厂Visual Basic数据库开发实例 刘志铭 高春艳 机械工业出版社2.4任务概述2.4.1、实现目标 面对宾馆行业的高速发展和宾馆行业信息化发展的过程中出现的各种情况,宾馆客房管理系统在实施后,应能达到以下目标:(1)实现多点操作的信息共享,相互之间的信息传递准确、快捷和顺畅(2)服务管理信息化,可随时掌握客人住宿、客房状态、客人挂帐等情况。(3)系统界面友好美观,操作简单易行,查询灵活方便,数据存储安全。(4)客户档案、挂帐信息、预警系统的结合,可对往来可户进行住宿监控,防止坏帐发生。(5)通过宾馆客房管理系统的实施,可逐步提高宾馆的管理水平,提升员工的素质。(6)系统维护方便可靠、有较高的安全性,满足实用性、先进性的要求。2.4.2运行环境1、本系统对运行环境无特殊要求,只要求操作系统为Windows98及以上的版本即可,(Windows98,2000,XP,等)。2、硬件方面:最底要求PII233MHZ,64M内存,建议配置:服务器P4 1.4G,128M以上,客户端P3 1G,64M以上。3、屏幕分辨率请设置为800*600或更高。2.4.3条件限制1、本软件的开发期限为5周,时间不足。2、缺少C/S(终端/服务器)软件开发的背景和知识,3、软件工程开发实际经验不足。2.5数据描述2.5.1信息需求(1)顾客信息:顾客姓名、顾客身分证、证件号码、(2)客房信息:房间号、房间类型 、房间价格(3)住宿登记信息:房间编号、顾客身份证、房间种类、房间位置、折扣、入住时间。(4)退房登记信息:顾客姓名、房间编号、客房标准、退房时间、折扣、所付金额、押金。2.5.2处理需求宾馆在运营中需要对宾馆资源、顾客信息、结算信息进行管理,如果有顾客来往,经过对客房状态的查询,查看是否有房间能及时为客户办理登记手续,如果有顾客来退房,能及时为顾客登记并办理退房手续,并且修改客房信息,因此,利用开发完成后的宾馆管理系统能够十分便利的对住房系统进行管理有利于提高效率。宾馆住房管理系统开发的任务是实现各种住房信息的系统规范化、自动化主要完成的功能有以下几个方面。2.5.2.1住宿的管理这个模块包括两个窗体,分别是住房登记窗体,退宿结帐窗体,它们二者相互联系,只有登记了住房才能有退房结帐。(1)住房登记在住房登记窗体中实现顾客的住房登记,主要是服务员把顾客的姓名、有效证件(身份证)、房间号码、客房标准、客房价格、住宿日期和时间、住宿天数、等录入系统中。(2)退房登记在退宿结帐窗口中要实现的是顾客退房的功能,窗体的凭证号码、姓名、房间号码、房间标准等信息要用下拉表的形式显示,因为这些信息在住房登记的时候被系统自动存入了数据库,只有数据库有顾客的信息才能实现退房。在计算了顾客的应付金额和结算了押金后点击确定,打印出清单就实现了顾客的退房。2.5.2.2查询管理这个模块要实现管理员对客房的查询,查询客房的住宿情况,只要进入该模块就能清楚的查出各个客房的客人的住宿情况,以及查看客房是否为脏房,然后进行管理,由负责人员进行打扫2.5.2.3设置管理这个模块主要用来保存操作员的权限,即操作员的代号、密码、权限等。2.5.2.4结帐管理这个模块主要用来设置客护退房时结帐的问题。2.6数据流图2.6.1总体数据流图
宾馆客房管理系统ER图.数据流图.功能模块图.流程图2.6.2分数据流图 住 宿 登 记D1 住宿信息 D2 退宿信息 1) 退房数据流图 客房号码 住宿信息 客房信息 D3 客房信息 2)客房数据流图 客房信息 客房信息 客房信息D3 客房信息 3)客房数据流图名字:住宿信息别名:住宿登记信息描述:顾客住宿是需要填写的登记表。定义:住宿信息=姓名+有效证件+客房类型+客房号码+住宿日期。位置:登记表名称:客房信息别名:宾馆客房的信息描述:描述宾馆各种客房的信息。定义:客房信息=客房标准+客房号码+客房价格+配置位置:客房登记 退房登记名称:退房信息别名:退饭登记信息描述:客人退房时需要填写的信息定义:退房信息=客人姓名+有效证件+房间标准+房间号码+住宿天数。位置:系统 退房登记信息名称:权限信息别名:权限登记信息描述:用来保存操作员的权限定义:权限信息=操作员+密码+客房预定+住宿登记+退宿登记+客房查询+密码。位置:系统2.8.2系统主要功能描述(1)住宿管理:客房预定、住宿登记、追加押金、调房登记、推房结帐。(2)客房管理:客房预定、客房查询、房态查看。(3)查询统计:预定房查询、住宿查询、退宿查询、宿费提醒。(4)系统设置:初始化、密码设置、权限设置。2.9性能需求2.9.1数据精度1)要按照严格的数据格式输入,否则系统不给予响应进行处理。2)查询时要保证查全率,所有相应域包含查询关键字的记录都应能查到。因为通常有文件的记录会很多,所以本系统采用了两种方法进行查询:直接查询和模糊查询。2.9.2时间特性一般操作的响应时间应在1~2秒内,对软磁盘和打印机的操作也应在可接受的时间内完成。2.10运行需求2.10.1用户界面超越VB的界面,全新感觉,操作简便,一目了然,视图优美等特点。并且采用菜单界面驱动方式,给操作用户带来了极大的便利,对用户友好。对鼠标和键盘单独支持。2.10.2硬件接口不需要特定的硬件或硬件接口进行支撑。486以上PC机均可运行此软件。2.10.3软件接口运行于Windows95及更高版本具有WIN32 API的操作系统之上。2.11其它要求1、系统的功能实现情况: 用户可在本系统下实现各种用户要求的功能2、系统的安全性: 对于系统的重要数据都有密码保护,具有一定的安全性3、系统的容错性: 用户输错数据都有提示信息,具有较好的容错性能。4、系统的封闭性: 用户的封闭性较好,用户基本上在提示信息下输数据。 第三章、数据库概念设计 3.1E-R图 3.1.1局部E-R图
宾馆客房管理系统第四章、数据库的逻辑设计
4.1关系模式 4.1.1关系住宿登记(房间号码、顾客姓名、房间种类、房间位置、房间备注信息、顾客身份证号码。入住时间)它是以房间号码和顾客身份证号码为主码的表中的其他数据分量是由主码房间号码和顾客身份证号码唯一标示的,所以他消除了非主属性对码的部分函数依赖,满足第二范式。 4.1.2退宿登记(顾客姓名、房间号码 客房标准、客房价格、住宿日期、住宿天数、实际住宿费、预预收押金、退宿日期)它是以顾客姓名和房间号码为主码的,消除了非主属性对主属性的部分函数依赖和传递函数依赖,所以满足第三范式。4.1.3关系客房(房间号码 房间标准、房间价格、)它是以房间号码为主码的由房间号码唯一确定其他的取值,消除了主属性对码的部分和传递函数依赖,所以关系客房达到了扩展的第三范式。4.1.4关系密码(用户名 密码 、权限)它是以用户名、密码为主码的,由用户名和密码唯一确定用户的权限,取消了主属性对码的部分和传递函数依赖,所以关系密码达到了扩展的第三范式。
4.2基本表(1)客房基础信息表表
字段名称 数据类型 字段大小房间号 文本 30房间类型 文本 50价格 货币 8房态 文本 4备注 文本 100配置 文本 100(2)登记表字段名称 数据类型 字段大小姓名 文本 50证件名称 文本 20证件号码 文本 20详细地址 文本 50房间号 文本 20客房类型 文本 10联系电话 文本 20客房价格 货币 8住宿日期 日期/时间 8住宿时间 日期/时间 8住宿天数 数字 双精度型宿费 货币 8折扣 数字 双精度型应收宿费 货币 8预收金额 货币 8退宿日期 日期/时间 8备注 文本 50结款方式 文本 10摘要 文本 200(3)权限设置表字段名称 数据类型 字段大小编号 是/否 50操作员 是/否 50密码 是/否 双精度型住宿登记 是/否 1退宿登记 是/否 1追加押金 是/否 1客房管理 是/否 1客房查询 是/否 1住宿查询 是/否 1退宿查询 是/否 1宿费查询 是/否 1客房销售报表 是/否 1操作员设置 是/否 1密码设置 是/否 1权限设置 是/否 1调房登记 是/否 1客户结款 是/否 1
(4)退房登记表
字段名称 数据类型 字段大小姓名 文本 50证件名称 文本 20证件号码 文本 20详细地址 文本 50房间号 文本 20客房类型 文本 10联系电话 文本 20客房价格 货币 8住宿日期 日期/时间 8住宿时间 日期/时间 8住宿天数 数字 双精度型宿费 货币 8折扣 文本 双精度型应收宿费 货币 8金额总计 货币 8预收宿费 日期/时间 8退还宿费 日期/时间 8退还日期 日期/时间 8备注 文本 84.3接口设计第五章、系统的实现与调试5.1系统流程设计第六章 系统的界面设计及源代码6.1系统登陆窗口界面Dim TIM As Integer '定义一个整型变量Dim myval As String '定义一个字符串变量Private Sub Form_Load() '自动识别数据库路径 Data1.DatabaseName = App.Path & "\KFGL.mdb" Data2.DatabaseName = App.Path & "\KFGL.mdb"End SubPrivate Sub Form_Activate()'当记录为零时,进入系统具有所有权限 If Data1.Recordset.RecordCount = 0 Then MsgBox ("请先设置操作员密码和权限!") Load main main.Show Unload Me Else Text1.SetFocus End IfEnd SubPrivate Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Text2.SetFocus '按回车键,text2获得焦点End SubPrivate Sub text2_KeyDown(KeyCode As Integer, Shift As Integer)If KeyCode = vbKeyReturn Then Cmd1.SetFocus '按回车键cmd1获得焦点If KeyCode = vbKeyUp Then Text1.SetFocusIf KeyCode = vbKeyDown Then Cmd1.SetFocusEnd SubPrivate Sub cmd1_Click() main.StatusBar1.Panels(4).Text = Text1.Text '赋值给main.StatusBar1.Panels(4).Text '验证操作员及密码 If Data2.Recordset.BOF = False Then Data2.Recordset.MoveFirst Data2.Recordset.FindFirst "操作员 like " + Chr(34) + Text1.BoundText + Chr(34) + "" If Data2.Recordset.NoMatch Then MsgBox ("操作员输入错误!") Else Data1.RecordSource = "select * from qxsz where 操作员='" & Text1.BoundText & "'" Data1.Refresh If Text1.BoundText <> "" And Text2.Text <> "" And Text2.Text = Data1.Recordset.Fields("密码") Then Load main main.Show Unload Me Else If TIM = 3 Then '密码输错3次,退出系统 myval = MsgBox("密码输入错误,请向系统管理员查询!", 0, "") If myval = vbOK Then End End If If Text1.BoundText = "" Then MsgBox ("请输入操作员!")lwfree.cn MsgBox ("请输入操作员密码!") Text2.SetFocus Else If Text2.Text <> Data1.Recordset.Fields("密码") Then MsgBox ("密码错误,请重新输入密码!") TIM = TIM + 1 Text2.SetFocus End If End If End If End If End IfEnd IfEnd SubPrivate Sub cmd2_Click() End
宾馆客房管理系统ER图.数据流图.功能模块图.流程图6.2系统主程序窗口界面Private Sub Form_Load() Data1.DatabaseName = App.Path & "\Kfgl.MDB" '自动识别数据库路径End SubPrivate Sub Form_Activate() '设置操作员权限 With Data1.Recordset If .BOF = False Then .MoveFirst .FindFirst "操作员 like " + Chr(34) + StatusBar1.Panels(4).Text + Chr(34) + "" If .NoMatch Then Else main.zjyj.Enabled = .Fields("追加押金") main.zsdj.Enabled = .Fields("住宿登记") main.Label1.Enabled = .Fields("住宿登记") main.tf.Enabled = .Fields("退宿登记") main.Label2.Enabled = .Fields("退宿登记") main.tfdj.Enabled = .Fields("调房登记") main.kfsz.Enabled = .Fields("客房管理") main.kfcx.Enabled = .Fields("客房查询") main.ftck.Enabled = .Fields("房态查看") main.khjk.Enabled = .Fields("客户结款") main.zscx.Enabled = .Fields("住宿查询") main.Label3.Enabled = .Fields("住宿查询") main.tfcx.Enabled = .Fields("退宿查询") main.sftx.Enabled = .Fields("宿费提醒") main.Label5.Enabled = .Fields("宿费提醒") main.Label4.Enabled = .Fields("客房销售报表") main.xstj.Enabled = .Fields("客房销售统计报表") main.czysz.Enabled = .Fields("操作员设置") main.ma.Enabled = .Fields("密码设置") main.csh.Enabled = .Fields("初始化") main.qxsz.Enabled = .Fields("权限设置") End If End WithEnd Sub
Private Sub label1_Click() '调入住宿登记 zsdj_ClickEnd SubPrivate Sub label2_Click() '调入退宿结帐 tf_ClickEnd SubPrivate Sub Label3_Click() '调入住宿查询 zscx_ClickEnd SubPrivate Sub Label4_Click() '调入客房销售报表 xsbb_ClickEnd SubPrivate Sub Label5_Click() '调入宿费提醒 sftx_ClickEnd SubPrivate Sub label6_Click() EndEnd Sub
Private Sub zjyj_Click() '调入追加押金 Load main_zjyj main_zjyj.Show main.Enabled = FalseEnd SubPrivate Sub tfdj_Click() '调入调房登记 main_tfdj.Show main.Enabled = FalseEnd SubPrivate Sub tf_Click() '调入退宿结帐 main_tf.Show main.Enabled = FalseEnd SubPrivate Sub kfsz_Click() '调入客房管理 main_kfgl.Show main.Enabled = FalseEnd SubPrivate Sub kfcx_Click() '调入客房查询 main_kfcx.Show main.Enabled = FalseEnd SubPrivate Sub ftck_Click() '调入房态查看 main_ftcx.Show main.Enabled = FalseEnd SubPrivate Sub gzcx_Click() '调入挂帐查询 Load main_gzcx main_gzcx.Show main.Enabled = FalseEnd SubPrivate Sub khjk_Click() '调入客户结款 Load main_khjk main_khjk.Show main.Enabled = FalseEnd Sub
Private Sub zscx_Click() '调入住宿查询 Load main_zscx main_zscx.Show main.Enabled = FalseEnd SubPrivate Sub tfcx_Click() '调入退宿查询 Load main_tfcx main_tfcx.Show main.Enabled = FalseEnd Sublwfree.cnPrivate Sub xsbb_Click() '调入客房销售报表 main_xsbb.Show main.Enabled = FalseEnd SubPrivate Sub xstj_Click() '调入客房销售统计 main_xstj.Show main.Enabled = FalseEnd SubPrivate Sub czysz_Click() '调入操作员设置 Load main_czysz main_czysz.Show main.Enabled = FalseEnd SubPrivate Sub ma_Click() '调入密码设置 main_mmsz.Show main.Enabled = FalseEnd SubPrivate Sub csh_Click() '调入初始化 main_csh.Show main.Enabled = FalseEnd SubPrivate Sub qxsz_Click() '调入权限设置 main_qxsz.Show main.Enabled = FalseEnd SubPrivate Sub tc_Click() EndEnd Sub6.3住宿管理设计6.3.1住宿登记
宾馆客房管理系统Private Sub ZSDJ_Change(Index As Integer) Select Case Index Case 6 ZSDJ(7).Text = Format(Val(ZSDJ(6).Text) * Val(ZSDJ(5).Text), "0.00") '计算折前宿费 ZSDJ(9).Text = ZSDJ(7).Text '赋值给ZSDJ(9) ZSDJ(8).Text = 100 DTP3.Value = DTP1.Value + Val(ZSDJ(6).Text) '计算退宿日期 Case 8 ZSDJ(9).Text = Format(Val(ZSDJ(7).Text) * Val(ZSDJ(8).Text) / 100, "0.00") '计算实际宿费 Case 10 If ZSDJ(10).Text <> "" Then ZSDJ(10).Text = Val(ZSDJ(10).Text) '用val函数将字符串转换为数字 DTP2.Value = DTP1.Value + Int(Val(ZSDJ(10).Text) / Val(ZSDJ(5).Text)) '计算提醒日期 If (Val(ZSDJ(10).Text) - Int(Val(ZSDJ(10).Text) / Val(ZSDJ(5).Text))) > 0.5 * Val(ZSDJ(5).Text) Then tim2.Value = #6:00:00 PM# Else tim2.Value = #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 Combo1.SetFocus '按回车键Combo1获得焦点 Case 1 If KeyCode = vbKeyReturn Then ZSDJ(2).SetFocus '按回车键ZSDJ(2)获得焦点 Case 2 If KeyCode = vbKeyReturn Then ZSDJ(3).SetFocus '按回车键ZSDJ(3)获得焦点 Case 3 If KeyCode = vbKeyReturn Then DBCombo1.SetFocus '按回车键ZSDJ(2)获得焦点 Case 4 If KeyCode = vbKeyReturn Then ZSDJ(5).SetFocus '按回车键ZSDJ(5)获得焦点 Case 5 If KeyCode = vbKeyReturn Then ZSDJ(6).SetFocus '按回车键ZSDJ(6)获得焦点 Case 6 If KeyCode = vbKeyReturn Then ZSDJ(10).SetFocus Case 8 If KeyCode = vbKeyReturn Then ZSDJ(10).SetFocus '按回车键ZSDJ(10)获得焦点 Case 10 If KeyCode = vbKeyReturn Then ZSDJ(11).SetFocus 'ZSDJ(11)获得焦点 Case 11 If KeyCode = vbKeyReturn Then Comok.SetFocus '按回车键Comok获得焦点 End SelectEnd SubPrivate Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then ZSDJ(1).SetFocus '按回车键ZSDJ(1)获得焦点End SubPrivate Sub DTP2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then tim3.SetFocus '按回车键tim3获得焦点End SubPrivate Sub DTP3_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then tim4.SetFocus '按回车键tim4获得焦点End SubPrivate Sub tim3_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then DTP3.SetFocus '按回车键DTP3获得焦点End SubPrivate Sub tim4_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Text10.SetFocus '按回车键Text10获得焦点End SubPrivate Sub DBCombo1_Change()'查询空闲房间信息 Data2.RecordSource = "select * from kf where 房间号='" & DBCombo1.Text & "'and 房态='空房'" Data2.Refresh'查询住宿登记信息 Data1.RecordSource = "select * from djb where 房间号='" & DBCombo1.Text & "'and 标志='1'" Data1.Refresh If Data2.Recordset.RecordCount > 0 Then If Data1.Recordset.RecordCount = 0 Then ZSDJ(4).Text = Data2.Recordset.Fields("房间类型") '赋值给ZSDJ(4) ZSDJ(5).Text = Data2.Recordset.Fields("价格") '赋值给ZSDJ(5) Else MsgBox ("此房间已占用或停止使用!!") End If End IfEnd SubPrivate Sub DBCombo1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then ZSDJ(5).SetFocus 'ZSDJ(5)获得焦点End SubPrivate Sub comdj_Click()'查询空闲房间信息Data2.RecordSource = "select * from kf where 房态='空房'"Data2.RefreshData3.RecordSource = "select * from kf where 房态='空房'"Data3.Refresh'生成凭证号码Data1.RecordSource = "select * from djb order by 凭证号码"Data1.RefreshIf Not Data1.Recordset.EOF Then Data1.Recordset.MoveLastIf lsph.Text = "" Then bh.Text = Date & "d" & Format(1, "###000")If lsph.Text <> "" Then y1.Text = Month(Date) y2.Text = Month(Left(lsph.Text, 10)) If y1.Text = y2.Text Then bh.Text = Date & "d" & Format(Val(Right(lsph.Text, 3)) + 1, "###000") End If If y1.Text <> y2.Text Then bh.Text = Date & "d" & Format(1, "###000") End IfEnd If'清空数据For i = 0 To 6 ZSDJ(i).Text = "" ZSDJ(i).Enabled = TrueNext i ZSDJ(8).Text = "": ZSDJ(10).Text = "": ZSDJ(11).Text = "": DBCombo1.Text = "": DBCombo1.Text = "" '设置控件有效或无效 Comok.Enabled = True: Comdj.Enabled = False: Comprint.Enabled = False: ZSDJ(8).Enabled = True ZSDJ(10).Enabled = True: ZSDJ(11).Enabled = True: DBCombo1.Enabled = True: Combo1.Enabled = True Combo2.Enabled = True: ZSDJ(0).SetFocus 'ZSDJ(0)获得焦点End SubPrivate Sub comok_Click() Dim mydb1 As Database Dim myrs1 As Recordset Set mydb1 = Workspaces(0).OpenDatabase(App.Path & "\kfgl.mdb") Set myrs1 = mydb1.OpenRecordset("djys", dbOpenTable) Data1.Recordset.FindFirst "房间号 like" + Chr(34) + DBCombo1.Text + Chr(34) + "and 标志 like" + Chr(34) + "1" + Chr(34) + "" If Data1.Recordset.NoMatch Then '添加住宿信息 Data1.Recordset.AddNew If bh.Text <> "" Then Data1.Recordset.Fields("凭证号码") = bh.Text If ZSDJ(0).Text <> "" Then Data1.Recordset.Fields("姓名") = ZSDJ(0).Text If Combo1.Text <> "" Then Data1.Recordset.Fields("证件名称") = Combo1.Text If ZSDJ(1).Text <> "" Then Data1.Recordset.Fields("证件号码") = ZSDJ(1).Text If ZSDJ(2).Text <> "" Then Data1.Recordset.Fields("详细地址") = ZSDJ(2).Text If ZSDJ(3).Text <> "" Then Data1.Recordset.Fields("出差事由") = ZSDJ(3).Text If DBCombo1.Text <> "" Then Data1.Recordset.Fields("房间号") = Val(DBCombo1.Text) If ZSDJ(4).Text <> "" Then Data1.Recordset.Fields("客房类型") = ZSDJ(4).Text If DTP1.Value <> "" Then Data1.Recordset.Fields("住宿日期") = DTP1.Value If tim1.Value <> "" Then Data1.Recordset.Fields("住宿时间") = tim1.Value If ZSDJ(5).Text <> "" Then Data1.Recordset.Fields("客房价格") = Val(ZSDJ(5).Text) If ZSDJ(6).Text <> "" Then Data1.Recordset.Fields("住宿天数") = ZSDJ(6).Text If ZSDJ(8).Text <> "" Then Data1.Recordset.Fields("折扣") = ZSDJ(8).Text If ZSDJ(7).Text <> "" Then Data1.Recordset.Fields("宿费") = ZSDJ(7).Text If Combo2.Text <> "" Then Data1.Recordset.Fields("结款方式") = Combo2.Text If ZSDJ(9).Text <> "" Then Data1.Recordset.Fields("应收宿费") = ZSDJ(9).Text If ZSDJ(10).Text <> "" Then Data1.Recordset.Fields("预收金额") = Val(ZSDJ(10).Text) If DTP2.Value <> "" Then Data1.Recordset.Fields("提醒日期") = DTP2.Value If tim2.Value <> "" Then Data1.Recordset.Fields("提醒时间") = tim2.Value If DTP3.Value <> "" Then Data1.Recordset.Fields("退宿日期") = DTP3.Value If tim3.Value <> "" Then Data1.Recordset.Fields("退宿时间") = tim3.Value
宾馆客房管理系统If ZSDJ(11).Text <> "" Then Data1.Recordset.Fields("备注") = ZSDJ(11).Text Data1.Recordset.Fields("日期") = Date Data1.Recordset.Fields("时间") = Time Data1.Recordset.Fields("BZ") = Left(Date, 4) & Right(Left(Date, 7), 2) & Right(Date, 2) & Left(Time, 2) & Left(Right(Time, 5), 2) Data1.Recordset.Fields("标志") = "1" '更新记录 Data1.Recordset.Update '添加住宿预收信息 myrs1.AddNew If bh.Text <> "" Then myrs1.Fields("凭证号码") = bh.Text If ZSDJ(0).Text <> "" Then myrs1.Fields("姓名") = ZSDJ(0).Text If Combo1.Text <> "" Then myrs1.Fields("证件名称") = Combo1.Text If ZSDJ(1).Text <> "" Then myrs1.Fields("证件号码") = ZSDJ(1).Text If ZSDJ(2).Text <> "" Then myrs1.Fields("详细地址") = ZSDJ(2).Text If ZSDJ(3).Text <> "" Then myrs1.Fields("出差事由") = ZSDJ(3).Text If DBCombo1.Text <> "" Then myrs1.Fields("房间号") = Val(DBCombo1.Text) If ZSDJ(5).Text <> "" Then myrs1.Fields("客房价格") = Val(ZSDJ(5).Text) If DTP1.Value <> "" Then myrs1.Fields("住宿日期") = DTP1.Value If tim1.Value <> "" Then myrs1.Fields("住宿时间") = tim1.Value If ZSDJ(6).Text <> "" Then myrs1.Fields("住宿天数") = ZSDJ(6).Text If Combo2.Text <> "" Then myrs1.Fields("结款方式") = Combo2.Text If ZSDJ(8).Text <> "" Then myrs1.Fields("折扣") = ZSDJ(8).Text If ZSDJ(7).Text <> "" Then myrs1.Fields("宿费") = ZSDJ(7).Text If ZSDJ(9).Text <> "" Then myrs1.Fields("应收宿费") = ZSDJ(9).Text If ZSDJ(10).Text <> "" Then myrs1.Fields("预收金额") = Val(ZSDJ(10).Text) If DTP2.Value <> "" Then myrs1.Fields("提醒日期") = DTP2.Value If tim2.Value <> "" Then myrs1.Fields("提醒时间") = tim2.Value If DTP3.Value <> "" Then myrs1.Fields("退宿日期") = DTP3.Value If tim3.Value <> "" Then myrs1.Fields("退宿时间") = tim3.Value If ZSDJ(11).Text <> "" Then myrs1.Fields("备注") = ZSDJ(11).Text myrs1.Fields("日期") = Date myrs1.Fields("时间") = Time myrs1.Fields("BZ") = Left(Date, 4) & Right(Left(Date, 7), 2) & Right(Date, 2) & Left(Time, 2) & Left(Right(Time, 5), 2) myrs1.Fields("标志") = "1" '更新记录 myrs1.Update '更新房间状态 Data2.Recordset.FindFirst "房间号 like " + Chr(34) + DBCombo1.Text + Chr(34) + "" Data2.Recordset.Edit Data2.Recordset.Fields("房态") = "入住" Data2.Recordset.Update '设置控件有效或无效 For i = 0 To 6 ZSDJ(i).Enabled = False Next i ZSDJ(8).Enabled = False: ZSDJ(10).Enabled = False: ZSDJ(11).Enabled = False DBCombo1.Enabled = False: Combo1.Enabled = False End If Comok.Enabled = False: Comprint.Enabled = True: Comdj.Enabled = True Comprint.SetFocusEnd SubPrivate Sub comcancel_Click() '取消操作 For i = 0 To 11 ZSDJ(i).Enabled = False Next i Comprint.Enabled = False: Comok.Enabled = False: DBCombo1.Enabled = False Combo1.Enabled = False: Combo2.Enabled = False: DTP2.Enabled = False: DTP3.Enabled = False tim2.Enabled = False: tim3.Enabled = False: Comdj.Enabled = TrueEnd SubPrivate Sub comprint_Click() '打印住宿登记单据 Printer.Height = 8000: Printer.Width = 8000 Printer.CurrentX = 1100: Printer.CurrentY = 300 Printer.FontSize = 12 Printer.Print "龙海宾馆 (住宿证) " Dim A, B, C, D As Integer A = 100: B = 500: C = 4800: D = 400 Printer.FontSize = 10 Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print Date & " " & Time & " NO." & bh.Text B = B + D Printer.Line (A, B + 100)-(C, B + 100) Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "姓名:" & ZSDJ(0).Text B = B + D Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "房间号:" & DBCombo1.Text B = B + D Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "押金:" & Format(ZSDJ(10).Text, "0.00") B = B + D Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print Combo2.Text & ":" & ZSDJ(8).Text & "%" B = B + D Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "补交日期: " & DTP2.Value B = B + D Printer.Line (A, B + 100)-(C, B + 100) Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "操作员: " & czy.Text & " 欢迎光临" Printer.EndDocEnd SubPrivate Sub comend_Click() Unload Me main.Enabled = TrueEnd Sub
6.3.2.追加押金Private Sub Text1_Change() '计算提醒日期及时间 DTP2.Value = DTP1.Value + Int(Val(Text3.Text) + Val(Text1.Text)) / Val(Text7.Text) If (Val(Text3.Text) + Val(Text1.Text) - Int(Val(Text3.Text) + Val(Text1.Text))) / Val(Text7.Text) > 0.5 * Val(Text7.Text) Then tim2.Value = #6:00:00 PM# Else tim2.Value = #12:00:00 AM# End IfEnd SubPrivate Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Command1.SetFocusEnd SubPrivate Sub Command1_Click() '保存追加押金信息 If Text1.Text <> "" And DBCombo1.Text <> "" Then '查询住宿登记信息 Data1.RecordSource = "select * from djb where 凭证号码='" & DBCombo1.Text & "'" Data1.Refresh If Data1.Recordset.RecordCount > 0 Then '编辑住宿登记信息 Data1.Recordset.Edit Data1.Recordset.Fields("预收金额") = Val(Text3.Text) + Val(Text1.Text) Data1.Recordset.Fields("提醒日期") = DTP2.Value Data1.Recordset.Fields("提醒时间") = tim2.Value Data1.Recordset.Update '更新数据 '查询住宿登记预收信息 Data3.RecordSource = "select * from djys where 凭证号码='" & DBCombo1.Text & "'" Data3.Refresh '编辑住宿登记预收信息 Data3.Recordset.Edit Data3.Recordset.Fields("预收金额") = Val(Text3.Text) + Val(Text1.Text) Data3.Recordset.Fields("提醒日期") = DTP2.Value Data3.Recordset.Fields("提醒时间") = tim2.Value Data3.Recordset.Update '更新数据 Data3.Refresh '设置控件有效或无效 Command1.Enabled = False: Command2.Enabled = False: Command4.Enabled = True Command5.Enabled = True: Command3.Enabled = Truelwfree.cn MsgBox ("请填写完整的数据,再保存!") End IfEnd SubPrivate Sub Command2_Click() '取消操作 DBCombo1.Enabled = False: Command1.Enabled = False: Command2.Enabled = False Command4.Enabled = False: Command5.Enabled = True: Command3.Enabled = True'清空数据 Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = "": Text5.Text = "": Text6.Text = "": Text7.Text = ""'初始化日期 DTP1.Value = Date: DTP2.Value = Date: DTP3.Value = DateEnd SubPrivate Sub Command3_Click() Unload Me main.Enabled = True '设置主窗体有效End SubPrivate Sub Command4_Click() '打印追加押金单据
宾馆客房管理系统ER图.数据流图.功能模块图.流程图 Printer.Height = 8000: Printer.Width = 8000 Printer.CurrentX = 1100: Printer.CurrentY = 300 Printer.FontSize = 12 Printer.Print "龙海宾馆 (追加押金) " Dim A, B, C, D As Integer A = 100: B = 500: C = 4800: D = 400 Printer.FontSize = 10 Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print Date & " " & Time & " NO." & DBCombo1.Text B = B + D Printer.Line (A, B + 100)-(C, B + 100) Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "姓名:" & Text1.Text Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "房间号:" & Text5.Text B = B + D Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "追加押金:" & Format(Text1.Text, "0.00") B = B + D Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "补交日期: " & DTP2.Value B = B + D Printer.Line (A, B + 100)-(C, B + 100) Printer.CurrentX = 100 + A Printer.CurrentY = B + 200 Printer.Print "操作员: " & czy.Text & " 欢迎光临" Printer.EndDocEnd SubPrivate Sub Command5_Click() '登记 Frame1.Enabled = True: DBCombo1.Enabled = True: Command1.Enabled = True Command2.Enabled = True: Command3.Enabled = False: Command4.Enabled = True Command5.Enabled = False Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = "" Text5.Text = "": Text6.Text = "": Text7.Text = "" DBCombo1.SetFocus 'DBCombo1获得焦点End Sub6.3.3调房登记
Private Sub Form_Load() '自动识别数据库路径 Data1.DatabaseName = App.Path & "\KFGL.MDB" Data2.DatabaseName = App.Path & "\KFGL.MDB" Data3.DatabaseName = App.Path & "\KFGL.MDB" Data4.DatabaseName = App.Path & "\KFGL.MDB"End SubPrivate Sub Form_Activate() czy.Text = main.StatusBar1.Panels(4).Text '赋值给czy.text '查询住宿登记信息 Data4.RecordSource = "select * from djb where 标志='1'" Data4.RefreshEnd SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = True '设置主窗体有效End SubPrivate Sub DBCombo1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texbz.SetFocus 'texbz获得焦点End SubPrivate Sub DBCOMBO2_Change() If DBCombo2.Text <> "" Then Data1.Recordset.FindFirst "房间号='" & DBCombo2.Text & "'and 标志='1'" If Data1.Recordset.NoMatch Then MsgBox ("请核准住宿房间和住宿人!") Else If Data1.Recordset.Fields("客房类型") <> "" Then With Data1.Recordset '查询空闲房间 Data2.RecordSource = "select * from kf where 房间类型='" & .Fields("客房类型") & "'and 房态='空房'" Data2.Refresh '赋值给bh.text等 If .Fields("凭证号码") <> "" Then bh.Text = .Fields("凭证号码") If .Fields("姓名") <> "" Then Texxmb.Text = .Fields("姓名") If .Fields("证件名称") <> "" Then Combo1.Text = .Fields("证件名称") If .Fields("证件号码") <> "" Then Texsfz.Text = .Fields("证件号码") If .Fields("客房价格") <> "" Then Texjg.Text = .Fields("客房价格") End With End If End If DBCombo1.Enabled = True Texbz.Enabled = True End IfEnd SubPrivate Sub DBCOMBO2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then DBCombo1.SetFocus '按回车键DBCombo1获得焦点End SubPrivate Sub texbz_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Comok.SetFocus '按回车键comok获得焦点End SubPrivate Sub comdj_Click() '登记 Frame2.Enabled = True: Frame3.Enabled = True: DBCombo2.Enabled = True DBCombo1.Enabled = True: Texjg.Enabled = True: Comok.Enabled = True Comcancel.Enabled = True: Comok.Enabled = True: Comdj.Enabled = False DBCombo2.SetFocus 'DBCombo2获得焦点End SubPrivate Sub comok_Click() '确定调房 Dim bh As String '定义一个字符串类型的变量 '查询空闲房间信息 Data2.RecordSource = "select * from kf where 房间号='" & DBCombo1.Text & "'and 房态='空房'" Data2.Refresh If Data2.Recordset.RecordCount > 0 Then Dim mydb1 As Database Dim myrs2 As Recordset Set mydb1 = Workspaces(0).OpenDatabase(App.Path & "\KFGL.MDB") '查询所有住宿登记信息 Data1.RecordSource = "select * from djb" Data1.Refresh Data1.Recordset.FindFirst "房间号 ='" & DBCombo2.Text & "'and 标志='1'" bh = Data1.Recordset.Fields("凭证号码") Data1.Recordset.Edit '编辑住宿登记信息 If DBCombo1.Text <> "" Then Data1.Recordset.Fields("房间号") = Val(DBCombo1.Text) If Texbz.Text <> "" Then Data1.Recordset.Fields("备注") = Texbz.Text Data1.Recordset.Fields("标志") = "1" Data1.Recordset.Fields("摘要") = "由源房" & DBCombo2.Text & "调到目标房" & DBCombo1.Text Data1.Recordset.Update '更新记录 Data3.RecordSource = "select * from djys where 凭证号码='" & Data1.Recordset.Fields("凭证号码") & "'" Data3.Refresh If Data3.Recordset.EOF = False Then Data3.Recordset.MoveLast If Data3.Recordset.BOF = False Then Data3.Recordset.MoveFirst If Data3.Recordset.RecordCount > 0 Then Data3.Recordset.MoveFirst For i = 1 To Data3.Recordset.RecordCount Data3.Recordset.Edit '编辑住宿登记预收信息 If DBCombo1.Text <> "" Then Data3.Recordset.Fields("房间号") = Val(DBCombo1.Text) If Texbz.Text <> "" Then Data3.Recordset.Fields("备注") = Texbz.Text Data3.Recordset.Fields("标志") = "1" Data3.Recordset.Fields("摘要") = "由源房" & DBCombo2.Text & "调到目标房" & DBCombo1.Text Data3.Recordset.Update '更新记录 If Data3.Recordset.EOF = False Then Data3.Recordset.MoveNext Next i End If '编辑客房状态 Data2.Recordset.Edit Data2.Recordset.Fields("房态") = "入住" Data2.Recordset.Update Data2.RecordSource = "select * from kf" Data2.Refresh Data2.Recordset.FindFirst "房间号 ='" & DBCombo2.Text & "'" Data2.Recordset.Edit Data2.Recordset.Fields("房态") = "空房" Data2.Recordset.Update '查询空闲房间信息 Data3.RecordSource = "select * from kf where 房态='空房'" Data3.Refresh Data4.Refresh '设置控件有效或无效 Texxmb.Enabled = False: Texsfz.Enabled = False: DBCombo1.Enabled = False DBCombo2.Enabled = False: Texbz.Enabled = False: Comok.Enabled = False Comcancel.Enabled = False: Comdj.Enabled = True '清空数据 DBCombo1.Text = "": DBCombo2.Text = "": Texxmb.Text = "" Texsfz.Text = "": Texbz.Text = "": Texjg.Text = "" Comdj.SetFocus 'Comdj获得焦点 Else MsgBox ("所选房间已有人入住,请选择空房,再保存!!!") End IfEnd SubPrivate Sub comcancel_Click() '取消操作 DBCombo2.Enabled = True: DBCombo1.Enabled = True: Comdj.Enabled = True Comok.Enabled = False: Texbz.Enabled = True DBCombo1.Text = "": DBCombo2.Text = "": Texxmb.Text = "" Texsfz.Text = "": Texbz.Text = "": Texjg.Text = ""End SubPrivate Sub comend_Click() Unload Me main.Enabled = True '设置主窗体有效End Sub
6.3.4退宿结帐
宾馆客房管理系统ublic Sub JS() '定义计算住宿天数的函数 If DTP2.Value > DTP1.Value Then If tim2.Value > #11:59:00 PM# Then If tim2.Value > #12:00:00 PM# Then If tim2.Value > #6:00:00 PM# Then Texts.Text = DTP2.Value - DTP1.Value + 1 Else Texts.Text = DTP2.Value - DTP1.Value + 0.5 End If Else Texts.Text = DTP2.Value - DTP1.Value End If Else Texts.Text = DTP2.Value - DTP1.Value End If Else If tim1.Value < #2:00:00 AM# Then If tim2.Value > #2:00:00 AM# Then If tim2.Value > #12:00:00 PM# Then If tim2.Value > #6:00:00 PM# Then Texts.Text = 1 + 1 Else Texts.Text = 1 + 0.5 End If Else Texts.Text = 1 End If Else Texts.Text = 1 End If Else Texts.Text = 1 End If End IfEnd SubPublic Sub ssje() '定义计算实收金额和退还金额的函数 Texssje.Text = Val(Texzhje.Text) + Val(Texzf.Text) + Val(Texdhf.Text) + Val(Texpcf.Text) + Val(Texhyf.Text) + Val(Textcf.Text) Texthje.Text = Val(Texyj.Text) - Val(Texssje.Text)End SubPrivate Sub Form_Load()'自动识别数据库路径 Data1.DatabaseName = App.Path & "\KFGL.MDB" Data2.DatabaseName = App.Path & "\KFGL.MDB" Data3.DatabaseName = App.Path & "\KFGL.MDB" Data4.DatabaseName = App.Path & "\KFGL.MDB" Data5.DatabaseName = App.Path & "\KFGL.MDB"End SubPrivate Sub Form_Activate() czy.Text = main.StatusBar1.Panels(4).Text '赋值给czy DTP2.Value = Date: tim2.Value = Time'查询住宿登记信息 Data5.RecordSource = "select 凭证号码 from djb where 标志='1'order by 凭证号码" Data5.RefreshEnd SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = True '设置主窗体有效End SubPrivate Sub DBCombo1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then DBCombo2.SetFocus '按回车键DBCombo2获得焦点End SubPrivate Sub DBCOMBO2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then DTP1.SetFocus '按回车键DTP1获得焦点End SubPrivate Sub Combo2_Click()If Combo2.Text = "折扣" Then Texzk.Text = 100 '赋值给Texzk.text Else Texzk.Text = 0End IfIf Combo2.Text = "挂帐" Then Lab10.Visible = True Texgzdw.Visible = True Texgzdw.Text = Texxm.Text '赋值给Texxm.textElse Lab10.Visible = False Texgzdw.Visible = False '设置Texgzdw不可见 Texgzdw.Text = ""End IfEnd SubPrivate Sub Combo3_Click() Texfjf.SetFocus 'Texfjf获得焦点 Texfjf.Text = "0" '赋值给Texfjf.textEnd SubPrivate Sub DBCombo4_Change() If DBCombo4.Text <> "" Then '查询住宿登记信息 Data1.RecordSource = "select * from djb where 凭证号码='" + DBCombo4.Text + "'" Data1.Refresh bh.Text = "T" & DBCombo4.Text '赋值给texxm.text等 If Data1.Recordset.RecordCount > 0 Then If Data1.Recordset.Fields("姓名") <> "" Then Texxm.Text = Data1.Recordset.Fields("姓名") If Data1.Recordset.Fields("证件名称") <> "" Then Combo1.Text = Data1.Recordset.Fields("证件名称") If Data1.Recordset.Fields("证件号码") <> "" Then Texsfz.Text = Data1.Recordset.Fields("证件号码") If Data1.Recordset.Fields("详细地址") <> "" Then Texdz.Text = Data1.Recordset.Fields("详细地址") If Data1.Recordset.Fields("房间号") <> "" Then DBCombo3.Text = Data1.Recordset.Fields("房间号") If Data1.Recordset.Fields("客房类型") <> "" Then DBCombo1.Text = Data1.Recordset.Fields("客房类型") If Data1.Recordset.Fields("客房价格") <> "" Then DBCombo2.Text = Data1.Recordset.Fields("客房价格") If Data1.Recordset.Fields("住宿日期") <> "" Then DTP1.Value = Data1.Recordset.Fields("住宿日期") If Data1.Recordset.Fields("住宿时间") <> "" Then tim1.Value = Data1.Recordset.Fields("住宿时间") If Data1.Recordset.Fields("住宿天数") <> "" Then Texts.Text = Data1.Recordset.Fields("住宿天数") If Data1.Recordset.Fields("预收金额") <> "" Then Texyj.Text = Data1.Recordset.Fields("预收金额") Else lwfree.cn '计算住宿天数 If DTP2.Value > DTP1.Value Then If tim2.Value > #11:59:00 AM# Then If tim2.Value > #6:00:00 PM# Then Texts.Text = DTP2.Value - CDate(DTP1.Value) + 1 Else Texts.Text = DTP2.Value - CDate(DTP1.Value) + 0.5 End If Else Texts.Text = DTP2.Value - CDate(DTP1.Value) End If Else If tim1.Value < #6:00:00 PM# Then If tim2.Value > #6:00:00 PM# Then Texts.Text = 1 Else Texts.Text = "0.5" Else Texts.Text = "0.5" End If End If Texxf.Text = Val(Texts.Text) * Val(DBCombo2.Text) '计算宿费 Texzhje.Text = Val(Texxf.Text) * Val(Texzk.Text) / 100 '计算折后金额 Texthje.Text = Val(Texyj.Text) - Val(Texzhje.Text) - Val(Texzf.Text) - Val(Texdhf.Text) '计算退还金额 End IfEnd SubPrivate Sub DBCombo4_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texzk.SetFocus '按回车键Texzk获得焦点End SubPrivate Sub TIM2_Change() Call JS '调用函数End SubPrivate Sub DTP2_Change() Call JS '调用函数End SubPrivate Sub texxm_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texsfz.SetFocus '按回车键Texsfz获得焦点End SubPrivate Sub texzhje_Change() Call ssje '调用函数End SubPrivate Sub texzf_Change() Call ssje '调用函数End SubPrivate Sub texdhf_Change() Call ssje '调用函数End SubPrivate Sub texssje_Change() Texxf.Text = Val(Texts.Text) * Val(DBCombo2.Text) '计算宿费 Call ssje '调用函数End SubPrivate Sub texssje_KeyDown(KeyCode As Integer, Shift As Integer)
宾馆客房管理系统ER图.数据流图.功能模块图.流程图If KeyCode = vbKeyReturn Then Texbz.SetFocusEnd SubPrivate Sub texpcf_Change() Call ssje '调用函数End SubPrivate Sub texhyf_Change() Call ssje '调用函数End SubPrivate Sub texfjf_Change() Texfjf.Text = Val(Texfjf.Text) If Combo3.Text = "电话费" Then Texdhf.Text = Val(Texfjf.Text) If Combo3.Text = "杂费" Then Texzf.Text = Val(Texfjf.Text) If Combo3.Text = "会议费" Then Texhyf.Text = Val(Texfjf.Text) If Combo3.Text = "停车费" Then Textcf.Text = Val(Texfjf.Text) If Combo3.Text = "赔偿费" Then Texpcf.Text = Val(Texfjf.Text)End SubPrivate Sub texfjf_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texssje.SetFocusEnd SubPrivate Sub textcf_Change() Call ssje '调用函数End SubPrivate Sub texts_Change() Texxf.Text = Val(Texts.Text) * Val(DBCombo2.Text) '计算宿费 Texzhje.Text = Val(Texxf.Text) * Val(Texzk.Text) / 100 '计算折后金额 '计算退还金额 Texthje.Text = Val(Texyj.Text) - Val(Texzhje.Text) - Val(Texzf.Text) - Val(Texdhf.Text)End SubPrivate Sub texts_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texzk.SetFocus '回车Texzk获得焦点End SubPrivate Sub texts_LostFocus() Texts.Text = Format(Val(Texts.Text), "0.0") '格式化天数End SubPrivate Sub texzk_Change()Texzk.Text = Val(Texzk.Text)Texzhje.Text = Val(Texxf.Text) * Val(Texzk.Text) / 100 '计算折后金额 '计算退还金额Texthje.Text = Val(Texyj.Text) - Val(Texzhje.Text) - Val(Texzf.Text) - Val(Texdhf.Text)End SubPrivate Sub texbz_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Comok.SetFocusEnd SubPrivate Sub zj_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texts.SetFocusEnd SubPrivate Sub texsfz_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texdz.SetFocusEnd SubPrivate Sub texzk_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texfjf.SetFocusEnd SubPrivate Sub comdj_Click() '登记 Texxm.Text = "": Texsfz.Text = "": Texfjf.Text = "": Texdz.Text = "": Texts.Text = "" Texzk.Text = "": Texyj.Text = "": DBCombo4.Text = "": Texzhje.Text = "": Texthje.Text = "" Texxf.Text = "": DBCombo1.Text = "": DBCombo2.Text = "": DBCombo3.Text = "": Texbz.Text = "" Textcf.Text = "0": Texzf.Text = "0": Texdhf.Text = "0": Texssje.Text = "0": Texpcf.Text = "0" Texhyf.Text = "0" Comok.Enabled = True: Comcancel.Enabled = True: Comdj.Enabled = False Comprint.Enabled = False: DBCombo4.Enabled = True: Texzk.Enabled = True DBCombo4.SetFocusEnd Sub6.4客房管理6.4.1客房设置main.Enabled = TrueEnd SubPrivate Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Combo2.SetFocus '查询客房信息 Data1.RecordSource = "select * from kf where 房间类型='" & Combo1.Text & "'" Data1.Refresh '赋值给texjg.text If Data1.Recordset.RecordCount > 0 Then Texjg.Text = Data1.Recordset.Fields("价格")End SubPrivate Sub texfjh_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Combo1.SetFocus '按回车键Combo1获得焦点End SubPrivate Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texjg.SetFocusEnd SubPrivate Sub texjg_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then DTP1.SetFocusEnd SubPrivate Sub DTP1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texsz.SetFocus '按回车键Texsz获得焦点End SubPrivate Sub texsz_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texpz.SetFocusEnd SubPrivate Sub texpz_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Texbz.SetFocusEnd SubPrivate Sub texbz_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Comsave.SetFocusEnd SubPrivate Sub comdj_Click() '登记 Texfjh.Text = "": Texjg.Text = "": Texsz.Text = "" Texpz.Text = "": Texbz.Text = "" Comsave.Enabled = True: Comcancel.Enabled = True: Comdj.Enabled = False Texfjh.SetFocusEnd SubPrivate Sub comsave_Click() '查找客房信息 Data1.Recordset.FindFirst "房间号 like" + Chr(34) + Texfjh.Text + Chr(34) + "" If Data1.Recordset.NoMatch Then '添加客房 Data1.Recordset.AddNew If Texfjh.Text <> "" Then Data1.Recordset.Fields("房间号") = Texfjh.Text If Combo1.Text <> "" Then Data1.Recordset.Fields("房间类型") = Combo1.Text If Combo2.Text <> "" Then Data1.Recordset.Fields("房态") = Combo2.Textlwfree.cn("标志") = "0" Data1.Recordset.Update '更新记录 Data1.Refresh Else '编辑客房信息 Data1.Recordset.Edit If Texfjh.Text <> "" Then Data1.Recordset.Fields("房间号") = Texfjh.Text If Combo2.Text <> "" Then Data1.Recordset.Fields("房态") = Combo2.Text If Combo1.Text <> "" Then Data1.Recordset.Fields("房间类型") = Combo1.Text If Texjg.Text <> "" Then Data1.Recordset.Fields("价格") = Texjg.Text If DTP1.Value <> "" Then Data1.Recordset.Fields("营业日期") = DTP1.Value If Texsz.Text <> "" Then Data1.Recordset.Fields("使用设置") = Texsz.Text If Texpz.Text <> "" Then Data1.Recordset.Fields("配置") = Texpz.Text If Texbz.Text <> "" Then Data1.Recordset.Fields("备注") = Texbz.Text If Texfjh.Text <> "" Then Data1.Recordset.Fields("标志") = "0" Data1.Recordset.Update '更新记录 Data1.Refresh End If'设置控件有效或无效 Comsave.Enabled = False: Comcancel.Enabled = False Comend.Enabled = True: Comdj.Enabled = TrueEnd SubPrivate Sub comcancel_Click() '取消操作 Texfjh.Text = "": Texjg.Text = "": Texsz.Text = "" Texpz.Text = "": Texbz.Text = "" Comsave.Enabled = False: Comcancel.Enabled = False: Comdj.Enabled = TrueEnd SubPrivate Sub comend_Click() main.Enabled = True Unload MeEnd Sub6.4.2客房查询
Private Sub Form_Load() '自动识别数据库路径 Data1.DatabaseName = App.Path & "\KFGL.MDB"End SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = TrueEnd SubPrivate Sub Text1_Change()'查询客房信息 Data1.RecordSource = "select * from kf where kf.房间号 like " + Chr(34) + Text1.Text + "*" + Chr(34) + "" Data1.RefreshEnd SubPrivate Sub Command1_Click() '允许修改客房信息 DBGrid1.AllowUpdate = TrueEnd SubPrivate Sub Command2_Click() '删除客房信息 If Data1.Recordset.RecordCount > 0 Then Data1.Recordset.Delete Data1.Refresh End IfEnd SubPrivate Sub Command3_Click() main.Enabled = True Unload MeEnd Sub6.4.3房态查看Private Sub Form_Activate() Dim i As Integer '定义一个整型变量 Dim criteria As String '定义一个字符串变量 Dim mydb1 As Database '定义数据库 Dim myrs1 As Recordset '定义字段 Dim myrs2 As Recordset Dim myrs3 As Recordset Set mydb1 = Workspaces(0).OpenDatabase(App.Path & "\kfgl.mdb") '定义数据环境 Set myrs1 = mydb1.OpenRecordset("kf", dbOpenSnapshot) '定义数据表 '入住房间查询 sql = "select * from kf where kf.房态 like " + Chr(34) + "入住" + Chr(34) + "" Set myrs2 = mydb1.OpenRecordset(sql) '维修房间查询 sql = "select * from kf where kf.房态 like " + Chr(34) + "维修" + Chr(34) + "" Set myrs3 = mydb1.OpenRecordset(sql) For i = 1 To 25 '房态显示 criteria = "房间号 ='" & Command1(i).Caption & "'" myrs1.FindFirst criteria If myrs1.NoMatch Then Else If myrs1.Fields("房态") = "空房" Then Command1(i).Picture = LoadPicture("") '空房 If myrs1.Fields("房态") = "入住" Then Command1(i).Picture = LoadPicture(App.Path & "\image\rz.ico") If myrs1.Fields("房态") = "维修" Then Command1(i).Picture = LoadPicture(App.Path & "\image\wx.ico") End If Next i If Not myrs2.EOF Then myrs2.MoveLast If Not myrs3.EOF Then myrs3.MoveLast Labsy.Caption = myrs2.RecordCount '客房入住数 Labwx.Caption = myrs3.RecordCount '客房维修数 Labkx.Caption = 25 - Val(Labwx.Caption) - Val(Labsy.Caption) '客房空闲数 Labsyl.Caption = Val(Labsy.Caption) / 25 * 100 & "%" '客房使用率End SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = TrueEnd SubPrivate Sub Command1_Click(Index As Integer) '查询住宿信息 main_zscx.Text2.Text = "1" If Index >= 0 <= 25 Then main_zscx.Data1.RecordSource = "select * from djb where 标志='1'and 房间号='" & Command1(Index).Caption & "'" main_zscx.Data1.Refresh End If Load main_zscx main_zscx.ShowEnd SubPrivate Sub Command2_Click() Unload Me main.Enabled = TrueEnd Sub6.5 挂帐管理6.5.1客户结款Private Sub Form_Load()'自动识别数据库路径 Data1.DatabaseName = App.Path & "\KFGL.MDB" Data2.DatabaseName = App.Path & "\KFGL.MDB"End Sub '客户结款 Data1.RecordSource = "select * from gzmx where 挂账单位='" & DBCombo1.Text & "'" Data1.Refresh If Data1.Recordset.EOF = False Then Data1.Recordset.MoveLast '添加客户结款信息 Data1.Recordset.AddNew Data1.Recordset.Fields("日期") = Date Data1.Recordset.Fields("时间") = Time Data1.Recordset.Fields("摘要") = "客户还款" Data1.Recordset.Fields("姓名") = Text2.Text If DBCombo1.Text <> "" Then Data1.Recordset.Fields("挂账单位") = DBCombo1.Text Data1.Recordset.Fields("还款金额") = Format(Val(Text1.Text), "0.00") Data1.Recordset.Fields("金额累计") = Format((Val(khye.Text) - Val(Text1.Text)), "0.00") Data1.Recordset.Update '更新记录 '清空数据 Text1.Text = "": khye.Text = "": Text2.Text = ""End SubPrivate Sub Command2_Click() main.Enabled = True Unload MeEnd Sub
6.6查询统计6.6.1.住宿查询Private Sub Form_Load() Data1.DatabaseName = App.Path & "\Kfgl.MDB" '自动识别数据库路径End SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = TrueEnd SubPrivate Sub Command1_Click() '查询住宿信息 Data1.RecordSource = "select * from djb where 姓名 like " + Chr(34) + Text1.Text + "*" + Chr(34) + "" Data1.RefreshEnd SubPrivate Sub Command2_Click() main.Enabled = True Unload MeEnd SubPrivate Sub Text1_Change()End Sub6.6.2退宿查询
宾馆客房管理系统Private Sub Form_Load() Data1.DatabaseName = App.Path & "\KFGL.MDB" '自动识别数据库路径End SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = TrueEnd SubPrivate Sub Text1_Change() '按客人姓名查询退宿信息 Data1.RecordSource = "select * from tfd where tfd.姓名 like " + Chr(34) + Text1.Text + "*" + Chr(34) + "" Data1.RefreshEnd SubPrivate Sub Command1_Click() '允许修改退宿记录 DBGrid1.AllowUpdate = TrueEnd SubPrivate Sub Command2_Click() '删除退宿记录If Data1.Recordset.RecordCount > 0 Then Data1.Recordset.Delete Data1.RefreshEnd IfEnd SubPrivate Sub Command3_Click() main.Enabled = True Unload MeEnd Sub6.6.3宿费提醒Private Sub Form_Load() Data1.DatabaseName = App.Path & "\KFGL.MDB" '自动识别数据库路径 DTP1.Value = DateEnd SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = TrueEnd SubPrivate Sub Command1_Click() '所有被提醒的客人 Data1.RecordSource = "select * from djb where 标志='1'order by 凭证号码" Data1.RefreshEnd SubPrivate Sub Command2_Click() '按设定的日期被提醒的客人 Data1.RecordSource = "select * from djb where djb.提醒日期 < " + Chr(35) + Str(DTP1.Value) + Chr(35) + "or djb.提醒日期 =" + Chr(35) + Str(DTP1.Value) + Chr(35) + "and djb.标志 like " + Chr(34) + "1" + Chr(34) + "order by 凭证号码" Data1.RefreshEnd SubPrivate Sub Command3_Click() main.Enabled = True Unload MeEnd Sub
6.7日结设计6.7.1客房销售报表Private Sub Form_Load()'自动识别数据库路径 Data1.DatabaseName = App.Path & "\KFGL.MDB" Data2.DatabaseName = App.Path & "\KFGL.MDB" czy.Text = main.StatusBar1.Panels(4).Text DTP1.Value = Date - 1: DTP2.Value = DateEnd SubPrivate Sub Form_Activate() G1.Text = Left(DTP1, 4) & Right(Left(DTP1, 7), 2) & Right(DTP1, 2) & Left(DTM1, 2) & Left(Right(DTM1, 5), 2) G2.Text = Left(DTP2, 4) & Right(Left(DTP2, 7), 2) & Right(DTP2, 2) & Left(DTM2, 2) & Left(Right(DTM2, 5), 2) Data1.RecordSource = "select * from tfd where tfd.BZ >" & Val(G1.Text) & " AND tfd.BZ<" & Val(G2.Text) & " order by 凭证号码" Data1.Refresh '统计各项费用 Data2.RecordSource = "select count(*)as 数量1,sum(应收宿费)as 应收宿费1,sum(杂费)as 杂费1,sum(电话费)as 电话费1 ,sum(会议费)as 会议费1,sum(存车费)as 存车费1,sum(赔偿费)as 赔偿费1,sum(金额总计)as 总计金额1,sum(预收宿费)as 预收宿费1,sum(退还宿费)as 退还宿费1 from tfd where tfd.BZ >" & Val(G1.Text) & "AND tfd.bz<" & Val(G2.Text) Data2.Refresh '设置MSFlexgrid的列宽 MS1.ColWidth(0) = 0: MS1.ColWidth(1) = 1500: MS1.ColWidth(2) = 600 MS1.ColWidth(3) = 0: MS1.ColWidth(4) = 0: MS1.ColWidth(5) = 0 MS1.ColWidth(7) = 600: MS1.ColWidth(8) = 0: MS1.ColWidth(9) = 450 MS1.ColWidth(10) = 0: MS1.ColWidth(11) = 0: MS1.ColWidth(12) = 450 MS1.ColWidth(13) = 0: MS1.ColWidth(14) = 840: MS1.ColWidth(15) = 450 MS1.ColWidth(16) = 900: MS1.ColWidth(17) = 450: MS1.ColWidth(18) = 780 MS1.ColWidth(19) = 780: MS1.ColWidth(20) = 780: MS1.ColWidth(21) = 780 MS1.ColWidth(22) = 780: MS1.ColWidth(23) = 780: MS1.ColWidth(24) = 780 MS1.ColWidth(25) = 0: MS1.ColWidth(26) = 0: MS1.ColWidth(27) = 0 MS1.ColWidth(28) = 0: MS1.ColWidth(29) = 0: MS1.ColWidth(30) = 0 MS1.ColWidth(31) = 0: MS1.ColWidth(6) = 0 MS2.ColWidth(0) = 4950: MS2.ColWidth(1) = 900: MS2.ColWidth(2) = 450 MS2.ColWidth(3) = 780: MS2.ColWidth(4) = 780: MS2.ColWidth(5) = 780lwfree.cn main.Enabled = True Unload MeEnd SubPrivate Sub Form_Load() Data1.DatabaseName = App.Path & "\KFGL.MDB" '自动识别数据库路径End SubPrivate Sub Form_Activate() Text1.SetFocus 'text1获得焦点End SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = TrueEnd SubPrivate Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Text2.SetFocus '回车text2获得焦点End SubPrivate Sub text2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Text3.SetFocus '回车text3获得焦点End SubPrivate Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Command1.SetFocus '回车Command1获得焦点End SubPrivate Sub Command1_Click() '保存操作员及密码 If Text1.Text <> "" Then If Text2.Text <> "" Then Data1.Recordset.AddNew Data1.Recordset.Fields("操作员") = Text1.Text Data1.Recordset.Fields("密码") = Text2.Text Data1.Recordset.Update '更新记录 Data1.Refresh
宾馆客房管理系统ER图.数据流图.功能模块图.流程图Text1.Text = "": Text2.Text = "": Text3.Text = "" MsgBox ("操作员设置成功!") End If Else MsgBox ("请输入操作员!") End IfEnd SubPrivate Sub Command2_Click() Text1.Text = "": Text2.Text = "": Text3.Text = ""End SubPrivate Sub Command3_Click() main.Enabled = True Unload MeEnd Sub6.8.2密码设置Private Sub Form_Load() Data1.DatabaseName = App.Path & "\KFGL.MDB" '自动识别数据库路径End SubPrivate Sub Form_Activate() Text1.SetFocus 'text1获得焦点End SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = TrueEnd SubPrivate Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Text2.SetFocus '回车text2获得焦点End SubPrivate Sub text2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Text3.SetFocus '回车text3获得焦点End SubPrivate Sub label1_Click() '修改操作员密码 Data1.RecordSource = "select * from qxsz where 操作员='" & Text1.Text & "'" Data1.Refresh If Text1.Text <> "" And Text2.Text <> "" And Text2.Text = Data1.Recordset.Fields("密码") Then If Text3.Text <> "" Then Data1.Recordset.Edit Data1.Recordset.Fields("密码") = Text3.Text MsgBox ("密码修改成功,退出操作员密码修改!") Data1.Recordset.Update main.Enabled = True Unload Me Else MsgBox ("请输入新密码!!") End If Else If Text1.Text = "" Then MsgBox ("请输入操作员!") Text1.SetFocus Else If Text1.Text <> Data1.Recordset.Fields("操作员") Then Text1.SetFocus Text1.Text = "" MsgBox ("无此操作员,请重新输入!") End If End If If Text2.Text = "" Then MsgBox ("请输入操作员原密码!") Text2.SetFocus Else If Text2.Text <> ma.Text Then MsgBox ("原密码错误,请重新输入原密码!") Text2.SetFocus End If End If End IfEnd SubPrivate Sub label2_Click() main.Enabled = True Unload MeEnd SubPrivate Sub Form_Load() '自动识别数据库路径 Data1.DatabaseName = App.Path & "\KFGL.MDB" Data2.DatabaseName = App.Path & "\KFGL.MDB"End SubPrivate Sub Form_Unload(Cancel As Integer) main.Enabled = TrueEnd SubPrivate Sub DBList1_Click() If Data2.Recordset.BOF = False Then Data2.Recordset.MoveFirst '查找操作员 Data2.Recordset.FindFirst "操作员='" & DBList1.BoundText & "'" If Data2.Recordset.NoMatch Then DBList1.BoundText = 0 Else '赋值给Check1 For i = 0 To 2 If Data2.Recordset.Fields(i) = -1 Then Check1(i).Value = 1 Else Check1(i).Value = 0 Next ilwfree.cn Check1(i).Value = 0Next iEnd SubPrivate Sub Command3_Click() '为操作员设置权限 If DBList1.BoundText <> "" Then Data2.Recordset.FindFirst "操作员= '" & DBList1.BoundText & "'" If Data2.Recordset.NoMatch Then Else Data2.Recordset.Edit For i = 0 To 20 Data2.Recordset.Fields(i) = Check1(i).Value Next i Data2.Recordset.Update '更新记录 Data2.Refresh End If End IfEnd SubPrivate Sub Command4_Click() '删除操作员 On Error Resume Next Data2.Recordset.Delete Data2.Refresh Data1.RefreshEnd SubPrivate Sub comend_Click() Unload Me main.Enabled = TrueEnd Sub Data1.Recordset.Fields("房态") = "空房" Data1.Recordset.Update If Data1.Recordset.EOF = False Then Data1.Recordset.MoveNext Next i End If End If End If Next Counter ProgressBar1.Visible = False ProgressBar1.Value = ProgressBar1.MinEnd SubPrivate Sub comend_Click() main.Enabled = True Unload MeEnd SubPrivate Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)End Sub