Você está na página 1de 58

1.

Synopsis:
The project entitled HOTEL MANAGEMENT SYSTEM
has been designed and developed for Hotel Days-inn.
The main aim of this project is computerization of all
customer needs. It is a database system for creating a
selective retrieved of information, for subsequent
analysis, manipulation and application.

The system has different modules for various activities.


The various modules of the system are rooms enquiry
details, reservation details, cancellation details, vacating
details, and restaurant information.

Implementation of this system requires the use of


computers with most versatile system. Hence, this
software is developed on MS-Windows platform using
Visual Basic 6.0.

This package if fully of menu-driven with pop-up menu


being given wherever there is a need. It is very simple in
its creation and all the user-friendly facilities are
provided. Messages are given wherever there is a need.
Special care has been made for data integrity and
security; in addition the authorization is also given.This
system of computerization is to ameliorate and make
more advantages than the existing system by being
 More efficient
 More reliable
 Time saving and
 Accurate

The unique micro computer server is used to maintain the


database in MS-ACCESS with Visual Basic as front end-
tool. The reason for choosing this package, Visual Basic
is because of utilization of graphical interface facility and
also of event-driven property.
2.Introduction:

This project is HOTEL MANAGEMENT SYSTEM; the


main aim of this project is gives the customer view of the
hotel. The customer needs in hotel are, enquiry about
rooms, reservation process, vacating process, canceling
the reservation, and the restaurant for food items.

In this project the first module gives the customer view


for lodging. The customer needs enquiry for first process.
So the enquiry process is shown in the project that works
more effectively than the manual process. The next
process of customer is reservation. This reservation is for
may today or future, for this the reservation form can
work more efficient than the manual process. This form
also checks the rooms for reservation dates. It is
interactive to the customer, if the rooms are not available
it gives message and not allows reserving for that date.

The next process for the customer is vacating the room.


For this he needs the total bills. Also he uses the
restaurant for food that information also we need in the
bill. The vacating form works for this information
effectively. This form calculates the user bills of room
and restaurant; it is minus by the advance. Shows the
total bill he need to pay. The cancellation process is the
next process of the customer. For this the cancellation
form works effectively. The customers reserved for future
needs the cancellation process. That time we need to
calculate the refund amount from the advance. For this,
this form works efficiently.

The next module gives the restaurant information for the


customer. The customer gives order from room and also
spot order. For the room order and the spot order the
customer having same process, only one different is for
the room order he need to select the id, and for the
customer order he need to enter the name. The last
module is reports of the hotel management system. It is
having all details of the database.
3.System Configuration:

This project was developed in the system saving Pentium


processor with the following configuration.

Processor : Pentium-MMX
RAM : 16MB
Cachememory : 256 KB
Speed : 166 MHz
Co-Processor : In Built
Monitor : SVGA
Resolution : 800 x 600 pixels
Hard Disk : 2 GB
Operating System : Windows ’me
Floppy drives : 1.2 MB, 1.44 MB
4.System Analysis:

In the hotel management system, the customer operations


in lodging, enquiry, reservation, vacating, and
cancellation, and in restaurant orders from the room, and
customer spot orders are the operations.

Exiting system:

The existed system is in that hotel is manual working.


Using this many problems can occur, for this system they
used some bill books. That time any customer came for
enquiry or reservation they need to check every
reservation in the book, that is surly time wasting
process. Also the man who is searching also important,
some times he may do some problems in the process. The
same problems in restaurant also possible, in the billing
time wasting are possible to occur. Some drawbacks of
this existed system are

 Time required to do manual work


 Calculation is difficult
 Security is low
 Searching is difficult
 Data entry is difficult

Need for computerization:


In order to escape from the disadvantages mentioned in
the existing system, the system need to computerize. In
the computer system we can over come these problems.
In this system we can eliminate time wasting process.
The searching is very easy to do compare to the manual
work. Also the calculations is very is to do. Data entry is
easier than the manual.

 As the variety of information and timeliness is now


of great importance.
 At every stage of operation a great deal of
information is required for checking, reserving and
billing.
 Easy and quick retrieval of data.
 Facilitation of proper security.
Project Modules:

Module1:(Lodging)
In this module, we have lodging details. Here enquiry of
the rooms, reservation of rooms for today or future,
vacating the room, and canceling the future reservation.
For the rooms enquiry, and the reservation the system
uses room, and reservation tables in the database. The
vacating process uses the reservation table; the vacating
table for process, and the cancellation process uses the
reservation table for the cancel future reservations.

Module 2:(Restaurant)
In this module, we have restaurant details, the orders are
from room or spot order by the customer. So, this checks
the order type, after that it allows the user to access the
menu, and allows the order for items. The room order the
payment is taken when they are vacating. For the spot
orders are current payments.

Module 3:(Reporting)
In this module, we have the reporting information about
the system. The room details, reservation details,
vacating information, cancellation details, item details,
restaurant details, also the restaurant bill item details are
included in this module.

5.System Description:

Welcome to Microsoft Visual Basic, the fastest and


easiest way to create applications for Microsoft
Windows®. Whether you are an experienced professional
or brand new to Windows programming, Visual Basic
provides you with a complete set of tools to simplify
rapid application development.

So what is Visual Basic? The "Visual" part refers to the


method used to create the graphical user interface (GUI).
Rather than writing numerous lines of code to describe
the appearance and location of interface elements, you
simply add prebuilt objects into place on screen. If you've
ever used a drawing program such as Paint, you already
have most of the skills necessary to create an effective
user interface.

The "Basic" part refers to the BASIC (Beginners All-


Purpose Symbolic Instruction Code) language, a
language used by more programmers than any other
language in the history of computing. Visual Basic has
evolved from the original BASIC language and now
contains several hundred statements, functions, and
keywords, many of which relate directly to the Windows
GUI. Beginners can create useful applications by
learning just a few of the keywords, yet the power of the
language allows professionals to accomplish anything
that can be accomplished using any other Windows
programming language.

The Visual Basic programming language is not unique to


Visual Basic. The Visual Basic programming system,
Applications Edition included in Microsoft Excel,
Microsoft Access, and many other Windows applications
uses the same language. The Visual Basic Scripting
Edition (VBScript) is a widely used scripting language
and a subset of the Visual Basic language. The
investment you make in learning Visual Basic will carry
over to these other areas.

Whether your goal is to create a small utility for yourself


or your work group, a large enterprise-wide system, or
even distributed applications spanning the globe via the
Internet, Visual Basic has the tools you need.

Data access features allow you to create databases, front-


end applications, and scalable server-side components for
most popular database formats, including Microsoft SQL
Server and other enterprise-level databases.

ActiveX™ technologies allow you to use the


functionality provided by other applications, such as
Microsoft Word processor, Microsoft Excel spreadsheet,
and other Windows applications. You can even automate
applications and objects created using the Professional or
Enterprise editions of Visual Basic.

Internet capabilities make it easy to provide access to


documents and applications across the Internet or intranet
from within your application, or to create Internet server
applications.

Your finished application is a true .exe file that uses a


Visual Basic Virtual Machine that you can freely
distribute.

Features:
Visual basic has so many features which helps the
developer feel free to develop the user friendly
environment. The features are
 It has so many toolbars such as standard
toolbar, edit toolbar, debug toolbar, form editor
toolbar, customizing a toolbar.
 It has great features to build the user interface
using The toolbox and custom controls and
components
 Properties windows to set the properties for
each components
 It supports wide range of data types
 Good controlling programming flow
 Determinate loops (for-next loop),
indeterminate loops (relational operators, do
while loop, do loops with AND, OR, NOT
 Making decisions (conditionals) like the else,
combining conditions in an if-then, the block if-
then, the Goto
 It has so many built in functions like string
functions, replace function, like and fuzzy
functions etc.
 Arrays, handling functions (split, filter
functions), sorting and searching, records all
these can be controlled by code
 Control arrays, list and combo box, the flex grid
controls
 We can build larger projects easily using
multiple forms, code modules, error trapping
 It allows object oriented programming
 It has tools and techniques for testing,
debugging, and optimization
 We can do graphics
 Since it is a event driven programming it has a
mouse event procedures
 It has a file system controls and file system
objects (file list boxes, drive list boxes)
 It can communicate with other windows
applications
 We can build Activex controls
 Vbscript can be use for building dynamic html
pages

Access features:

Microsoft Access appeared out of nowhere at the end of


1992 to rapidly become the database of choice for
Windows based database development. Access is a
relational database designed for the modern Windows
environment, it does not carry the baggage and pre-
Windows design history of earlier database systems (such
as FoxPro, Microsoft's other database system). Access is
now in its fifth major incarnation (versions 1.0, 2.0, 95,
97 and now 2000) and just keeps on getting better.

What's new about the Database window


The Database window in Microsoft Access 2000 provides
a variety of options for viewing and manipulating
database objects.

 Use the Database window toolbar Quickly


find commands for creating, opening, or
managing database objects.
 Use the Objects bar View database objects in

the Objects bar — its vertical orientation makes


it easier to use.

 Organize database objects into groups Click


the Groups bar to view your groups, which can
contain shortcuts to database objects of
different types.

 Use new object shortcuts In the Database


window, quickly create a new database object
by using a wizard, or open a new database
object in design view.

 Customize how you select and open objects in

the Database window If you choose, change


the default behavior so that you select a
database object by resting the pointer over it,
and open an object by single-clicking it.

 Select an object by typing its name For


example, select the Shippers table while
viewing the list of table objects by typing Sh.

Microsoft Access 2000 provides many new features that


make working with data and designing a database even
easier.

Use record-level locking A Microsoft Access database


now supports record-level locking, in addition to page-
level locking. You enable the locking level with the new
database option, Open databases using record level
locking (Tools menu, Options command, Advanced Tab).
The actual level that is used depends on how the Access
database is programmed.

Find and replace You can now move freely between the
Find and Replace dialog boxes and the data in the view
or window.

View related data in a subdatasheet Use a subdatasheet


to view and edit related or joined data in a table, query, or
form datasheet, or in a subform all from the same view.
For example, in the Northwind sample database the
Suppliers table has a one-to-many relationship with the
Products table; so for each row of the Suppliers table in
Datasheet view, you can view and edit the related rows of
the Products table in a subdatasheet.

Automatically fix errors caused by renaming fields


Name AutoCorrect automatically corrects common side
effects that occur when you rename forms, reports,
tables, queries, fields, text boxes or other controls.

Take advantage of Unicode support Use the characters


of any language that Unicode supports in your data. Use
Unicode compression to offset the effect of Unicode's
increased storage space requirements. Take advantage of
dual-font support — specify a substitute font that you can
use in addition to your default font to properly display all
of the characters in your data.

Print relationships Print a report of the relationships in


your Access database as they appear in the Relationships
window.

Use the keyboard to manage relationships Use the


keyboard to create, edit, and delete relationships and
joins.

Use Microsoft ActiveX Data Objects (ADO) Use


Microsoft ActiveX Data Objects (ADO) to access and
manipulate data in a database server through any OLE
DB provider.

What's new about forms and reports


Microsoft Access 2000 provides new features to make it
faster and easier to create great-looking forms and
reports.

Group text boxes and other controls Use the Group


command on the Format menu to group related text
boxes and other controls on a form or report.

Define conditional formatting rules for text boxes and


other controls Use the Conditional Formatting
command on the Format menu to define the font color,
font size, control background color, and other visual
information that gives feedback to users as they enter
data on a form.

Create forms and reports for SQL Server databases In a


Microsoft Access project, create forms and reports for an
SQL Server database with the same tools that you use to
create them in a Microsoft Access database.

Distribute reports to users who don't have Microsoft


Access Export Microsoft Access reports to report
snapshot (.snp) file format. You can use Snapshot Viewer
to view, print, and mail report snapshots.
6.Data Flow Diagram:

USER

Lodgin Resstauran Reports


g t

Room
Enquiry

Reservation

Reservatio
Vacating
n
Item
Vacating
Restbill

Billitems
Cancellation
7.Database Structures:

Room Table:

Field Name Data Type Description


Rtype Text Room Type
Total Integer Total Rooms
Price Currency Cost Of Room

Reservation Table:

Field Name Data Type Description


Cid Integer Customer ID
Cname Text Customer Name
Add Text Address
Tel Integer Telephone number
Rtype Text Room type
Noofrooms Integer No. of rooms
Noofdays Integer No. of days
Indate Date/time In date
Intime Date/time In time
Advance Currency Room advance
Status Text Fucture or current

Vacating Table:

Field Name Data Type Description


Bno Integer Bill no.
cid Integer Customer id
Name Text Customer name
Rtype Text Room type
Noofrooms Integer No. of rooms
Indate Date/time In date
Outdate Date/time Out date
Outtime Date/time Out time
Restbill Currency Restaurant bill
Roombill Currency Room bill
Total Currency Total bill
Status Text Vacated or cancel
Item Table:

Field Name Data Type Description


Status Text Item Type
Name Text Item name
Price Currency Cost of item

Restaurant Table:
Field Name Data Type Description
Bno Integer Bill no.
cid Integer Customer id
Name Text Customer name
Amt Currency Total amount

Bill Items Table:

Field Name Data Type Description


Bno Integer Bill no.
Item Text Item name
Qty Integer Item qty
Price Currency Total amount
8.Project Coding:

Dim DB As Database
Dim RS As Recordset
Dim RS1 As Recordset
Dim RS2 As Recordset
Dim RS3 As Recordset
Dim RS4 As Recordset
Dim RS5 As Recordset
Dim FRAMEFLAG1 As Integer
Dim L As String
Dim T As Date
Dim I As Integer
Dim J As Currency
Dim RESFLAG As Integer
Dim RESTFLAG As Integer
Dim ITMS As String
Dim VAFLAG As Integer
Dim CANFLAG As Integer

Private Sub Image11_Click()


DataReport1.Show
End Sub

Private Sub Image12_Click()


DataReport6.Show
End Sub

Private Sub Image13_Click()


DataReport2.Show
End Sub

Private Sub Image14_Click()


DataReport3.Show
End Sub

Private Sub Image15_Click()


RM = InputBox("ENTER THE ID")
DataReport1.Refresh
DataEnvironment1.Command4 RM
DataReport4.Show
End Sub

Private Sub Image16_Click()


RM = InputBox("ENTER THE ID")
DataReport1.Refresh
DataEnvironment1.Command5 RM
DataReport5.Show
End Sub

Private Sub Option3_Click()


If Option3.Value = True Then
Frame1.Visible = True
Frame10.Visible = True
Frame2.Visible = False
Frame3.Visible = False
Frame4.Visible = False
Frame5.Visible = False
Frame6.Visible = False
Frame8.Visible = False
Frame9.Visible = False
FRAMEFLAG1 = 1
End If

End Sub

Private Sub Timer1_Timer()


Label2.Caption = Date
Label3.Caption = Time
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase("C:\MADHURIMA\DAYS.mdb")
Set RS = DB.OpenRecordset("ROOM", 2)
Set RS1 = DB.OpenRecordset("RES", 2)
Set RS2 = DB.OpenRecordset("VACATING", 2)
Set RS3 = DB.OpenRecordset("ITEM", 2)
Set RS4 = DB.OpenRecordset("RESTBILL", 2)
Set RS5 = DB.OpenRecordset("BITEMS", 2)
Frame1.Visible = False
Image5.Visible = False
CLEAR
TXTE
FRV
FRAMEFLAG1 = 0
D=0
RESFLAG = 0
RESTFLAG = 0
VAFLAG = 0
CANFLAG = 0

End Sub

Private Sub Image10_Click()


If CANFLAG = 1 Then
Text36.Text = (Val(Text35.Text) / 10) * 8
Text37.Text = Val(Text35.Text) - Val(Text36.Text)
List10.Enabled = False
CANFLAG = 2
ElseIf CANFLAG = 2 Then
CAM = MsgBox("SURE DO U WANT TO CANCEL", vbYesNo)
If CAM = vbYes Then
If RS2.BOF Then
BILLNO = 1
Else
RS2.MoveLast
BILLNO = RS2(0) + 1
End If
RS2.AddNew
RS2(0) = BILLNO
RS2(1) = List10.Text
RS2(2) = Text31.Text
RS2(3) = Text32.Text
RS2(4) = Text33.Text
RS2(5) = Text34.Text
RS2(6) = Date
RS2(7) = Time
RS2(8) = O
RS2(9) = Text37.Text
RS2(10) = Text37.Text
RS2(11) = "CANCEL"
RS2.Update
RS1.FindFirst "[CID]=" & Val(List10.Text)
RS1.Delete
MsgBox "CANCELLED"
CANFLAG = O
Option12.Value = False
ElseIf CAM = vbNo Then
List10.Enabled = True
End If
End If

End Sub

Private Sub Image2_Click()


If ((RESFLAG = 2) And (Text7.Text)) Then
RS1.AddNew
RS1(0) = Text4.Text
RS1(1) = Text5.Text
RS1(2) = Text6.Text
RS1(3) = Text7.Text
RS1(4) = List3.Text
RS1(5) = Text9.Text
RS1(6) = Text10.Text
RS1(7) = Text11.Text
RS1(8) = Text12.Text
RS1(9) = Text13.Text
RS1(10) = Text28.Text
RS1.Update
MsgBox "RESERVAED"
Image2.Visible = False
RESFLAG = 0
ElseIf RESFLAG = 3 Then
RS1.FindFirst "[CID]=" & Val(List2.Text)
RS1.Edit
RS1(0) = List2.Text
RS1(1) = Text5.Text
RS1(2) = Text6.Text
RS1(3) = Text7.Text
RS1(4) = Text8.Text
RS1(5) = Text9.Text
RS1(6) = Text10.Text
RS1(7) = Text11.Text
RS1(8) = Text12.Text
RS1(9) = Text13.Text
RS1(10) = Text28.Text
RS1.Update
MsgBox "RESERVAED"
Image2.Visible = False
RESFLAG = 0
ElseIf ((RESFLAG = 1) And (List2.Text <> "")) Then
N = MsgBox("D U WANT TO RESERVE", vbOKCancel)
If N = vbOK Then
RESFLAG = 3
D2 = DateAdd("d", Val(Text10.Text), Text11.Text)
D3 = DateDiff("d", Date, D2)
If D3 <> 0 Then
Text10.Text = D3
Else
Text10.Text = 1
End If
Text11.Text = Date
Text12.Text = Time
Text28.Text = "C"
End If
End If

End Sub

Private Sub Image3_Click()


If VAFLAG = 1 Then
RAMT = 0
ROOMAMT = 0
ROOMD = 0
Text18.Text = Date
Text19.Text = Time
If Not RS4.BOF Then
RS4.MoveFirst
Do While Not RS4.EOF
If RS4(1) = Val(List4.Text) Then
RAMT = RAMT + RS4(3)
End If
RS4.MoveNext
Loop
End If
Text20.Text = RAMT
RS.FindFirst "[RTYPE]='" & Text15.Text & " '"
ROOMAMT = RS(2) * Val(Text16.Text)
RS1.FindFirst "[CID]=" & Val(List4.Text)
ROOMD = DateDiff("d", RS1(7), Date)
If ROOMD = 0 Then
ROOMD = 1
End If
ROOMAMT = ROOMAMT * ROOMD
Text21.Text = ROOMAMT - RS1(9)
Text22.Text = Val(Text20.Text) + Val(Text21.Text)
List4.Enabled = False
VAFLAG = 2
ElseIf VAFLAG = 2 Then
M = MsgBox("DO U WANT TO VACATE", vbYesNo)
If M = vbYes Then
If RS2.BOF Then
BILL = 1
Else
RS2.MoveLast
BILL = RS2(0) + 1
End If
RS2.AddNew
RS2(0) = BILL
RS2(1) = List4.Text
RS2(2) = Text14.Text
RS2(3) = Text15.Text
RS2(4) = Text16.Text
RS2(5) = Text17.Text
RS2(6) = Text18.Text
RS2(7) = Text19.Text
RS2(8) = Text20.Text
RS2(9) = Text21.Text
RS2(10) = Text22.Text
RS2(11) = "VACATED"
RS2.Update
RS1.FindFirst "[CID]=" & Val(List4.Text)
RS1.Delete
MsgBox "THANQ VISIT AGAIN"
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
List1.Enabled = True
If Not RS1.BOF Then
RS1.MoveFirst
Do While Not RS1.EOF
If ((RS1(10) = "C") And (RS1(7) >= Date)) Then
List4.AddItem RS1(0)
End If
RS1.MoveNext
Loop
End If
VAFLAG = 0
End If
End If

End Sub

Private Sub Image4_Click()


If RESTFLAG = 1 Then
R = MsgBox("Room Order", vbYesNo)
If R = vbYes Then
MsgBox "SELECT CUSTOMER ID"
Label30.Visible = True
List5.Visible = True
List5.Enabled = True
Text24.Enabled = False
RESTFLAG = 2
ElseIf R = vbNo Then
MsgBox "Enter Customer Name"
Label30.Visible = False
List5.Visible = False
Text24.Enabled = True
RESTFLAG = 3
End If
ElseIf (((RESTFLAG = 2) Or (RESTFLAG = 3)) And (Text24.Text <>
"")) Then
If RS4.BOF Then
Text23.Text = 100
Else
RS4.MoveLast
Text23.Text = RS4(0) + 1
End If
RESTFLAG = 4
List5.Enabled = False
List6.Enabled = True
Text24.Enabled = False
Image4.Visible = False
ElseIf RESTFLAG = 4 Then
If List5.Visible = False Then
ID = -1
Else
ID = Val(List5.Text)
End If
RS4.AddNew
RS4(0) = Text23.Text
RS4(1) = ID
RS4(2) = Text24.Text
RS4(3) = Text27.Text
RS4.Update
For LCOUNT = 0 To (List7.ListCount - 1)
RS5.AddNew
RS5(0) = Text23.Text
RS5(1) = List7.List(LCOUNT)
RS5(2) = List8.List(LCOUNT)
RS5(3) = List9.List(LCOUNT)
RS5.Update
Next
MsgBox "THANQ"
RESTFLAG = 1
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
List6.CLEAR
List7.CLEAR
List8.CLEAR
List9.CLEAR
List6.Enabled = False
Label30.Visible = True
List5.Visible = True
End If

End Sub

Private Sub Image5_Click()


If FRAMEFLAG1 = 1 Then
Frame1.Visible = True
Frame2.Visible = False
Frame3.Visible = False
Frame4.Visible = False
Frame5.Visible = False
Frame6.Visible = False
Frame8.Visible = False
Frame9.Visible = False
Frame10.Visible = False
Option1.Value = False
Option2.Value = False
Option3.Value = False
FRAMEFLAG1 = 0
Else
Frame1.Visible = False
Frame8.Visible = True
Image5.Visible = False
CLEAR
TXTE
End If

End Sub

Private Sub Image6_Click()


M = MsgBox("B4 U RESERVED", vbYesNoCancel)
If M = vbNo Then
CLEAR
List2.Visible = False
Text4.Visible = True
Text8.Visible = False
List3.Visible = True
Image6.Visible = False
Image2.Visible = False
If Not RS.BOF Then
RS.MoveFirst
Do While Not RS.EOF
List3.AddItem RS(0)
RS.MoveNext
Loop
End If
If RS1.BOF Then
Text4.Text = 1
Else
RS1.MoveLast
Text4.Text = RS1(0) + 1
End If
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text9.Enabled = True
Text10.Enabled = True
Text11.Enabled = True
RESFLAG = 2
ElseIf M = vbYes Then
CLEAR
List2.CLEAR
List2.Enabled = True
If Not RS1.BOF Then
RS1.MoveFirst
Do While Not RS1.EOF
If RS1(10) = "F" Then
D1 = DateAdd("d", RS1(6), RS1(7))
If ((RS1(7) <= Date) And (D1 >= Date)) Then
List2.AddItem RS1(0)
End If
End If
RS1.MoveNext
Loop
End If
Image6.Visible = False
Image2.Visible = True
RESFLAG = 1
End If

End Sub

Private Sub Image8_Click()


If (Text29.Text = "MADHURIMA" Or Text29.Text = "madhurima")
And (Text30.Text = "DAYSINN" Or Text30.Text = "daysinn") Then
Frame1.Visible = True
Frame8.Visible = False
Image5.Visible = True
Option1.Value = False
Option2.Value = False
Option3.Value = False
Else
MsgBox "Error In Login"
Text29.SetFocus
End If

End Sub

Private Sub Image9_Click()


End
End Sub

Private Sub List1_Click()


Text1.Enabled = True
End Sub

Private Sub List10_Click()


RS1.FindFirst "[CID]=" & Val(List10.Text)
Text31.Text = RS1(1)
Text32.Text = RS1(4)
Text33.Text = RS1(5)
Text34.Text = RS1(7)
Text35.Text = RS1(9)
Text36.Text = ""
Text37.Text = ""
CANFLAG = 1

End Sub

Private Sub List2_Click()


RS1.FindFirst "[CID]=" & Val(List2.Text)
Text5.Text = RS1(1)
Text6.Text = RS1(2)
Text7.Text = RS1(3)
Text8.Text = RS1(4)
Text9.Text = RS1(5)
Text10.Text = RS1(6)
Text11.Text = RS1(7)
Text12.Text = RS1(8)
Text13.Text = RS1(9)
Text28.Text = RS1(10)

End Sub

Private Sub List4_Click()


RS1.FindFirst "[CID]=" & Val(List4.Text)
Text14.Text = RS1(1)
Text15.Text = RS1(4)
Text16.Text = RS1(5)
Text17.Text = RS1(7)
VAFLAG = 1
List4.Enabled = True
End Sub

Private Sub List5_Click()


RS1.FindFirst "[CID]=" & Val(List5.Text)
Text24.Text = RS1(1)
End Sub

Private Sub List6_Click()


RS3.FindFirst "[NAME]= '" & List6.Text & " '"
Text25.Text = RS3(2)
Text26.Enabled = True
Text26.SetFocus

End Sub

Private Sub Option1_Click()


If Option1.Value = True Then
Frame2.Visible = True
Frame3.Visible = False
Frame4.Visible = False
Frame5.Visible = False
Frame6.Visible = False
Frame9.Visible = False
Frame8.Visible = False
Frame10.Visible = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
Option12.Value = False
End If
FRAMEFLAG1 = 1

End Sub

Private Sub Option10_Click()


If Option10.Value = True Then
ITMS = Option10.Caption
GITEMS
End If

End Sub

Private Sub Option11_Click()


If Option11.Value = True Then
ITMS = Option11.Caption
GITEMS
End If

End Sub

Private Sub Option12_Click()


If Option12.Value = True Then
Frame1.Visible = False
Frame3.Visible = False
Frame4.Visible = False
Frame5.Visible = False
Frame6.Visible = False
Frame7.Visible = False
Frame8.Visible = False
Frame9.Visible = True
Frame10.Visible = False
List10.Enabled = True
CLEAR
TXTE
If Not RS1.BOF Then
RS1.MoveFirst
Do While Not RS1.EOF
If RS1(10) = "F" And RS1(7) >= Date Then
List10.AddItem RS1(0)
End If
RS1.MoveNext
Loop
End If

CANFLAG = 0
End If
End Sub

Private Sub Option2_Click()


If Option2.Value = True Then
Frame1.Visible = True
Frame2.Visible = False
Frame3.Visible = False
Frame4.Visible = False
Frame5.Visible = False
Frame7.Visible = True
Frame8.Visible = False
Frame9.Visible = False
Frame10.Visible = False
Frame6.Visible = True
Label30.Visible = True
List5.Visible = True
List5.Enabled = False
Image4.Visible = True
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
FRAMEFLAG1 = 1
RESTFLAG = 1
List5.CLEAR
List6.CLEAR
List7.CLEAR
List8.CLEAR
List9.CLEAR
If Not RS1.BOF Then
RS1.MoveFirst
Do While Not RS1.EOF
If RS1(10) = "C" Then
List5.AddItem RS1(0)
End If
RS1.MoveNext
Loop
End If
FRAMEFLAG1 = 1
End If

End Sub

Private Sub Option4_Click()


If Option4.Value = True Then
Frame3.Visible = True
Frame1.Visible = False
Frame4.Visible = False
Frame5.Visible = False
Frame6.Visible = False
Frame8.Visible = False
Frame9.Visible = False
Frame10.Visible = False
CLEAR
TXTE
If Not RS.BOF Then
RS.MoveFirst
Do While Not RS.EOF
List1.AddItem RS(0)
RS.MoveNext
Loop
End If
End If

End Sub

Private Sub Option5_Click()


If Option5.Value = True Then
Frame4.Visible = True
Frame2.Visible = True
Frame1.Visible = False
Frame3.Visible = False
Frame5.Visible = False
Frame6.Visible = False
Frame8.Visible = False
Frame9.Visible = False
Frame10.Visible = False
Text4.Visible = False
List3.Visible = False
List2.Visible = True
Text8.Visible = True
Image2.Visible = False
Image6.Visible = True
CLEAR
TXTE
If Not RS1.BOF Then
RS1.MoveFirst
Do While Not RS1.EOF
If RS1(10) = "C" Then
List2.AddItem RS1(0)
End If
RS1.MoveNext
Loop
End If
End If

End Sub

Private Sub Option6_Click()


If Option6.Value = True Then
VAFLAG = 0
Frame5.Visible = True
Frame1.Visible = False
Frame3.Visible = False
Frame4.Visible = False
Frame6.Visible = False
Frame8.Visible = False
Frame9.Visible = False
Frame10.Visible = False
List4.Enabled = True
List4.CLEAR
If Not RS1.BOF Then
RS1.MoveFirst
Do While Not RS1.EOF
If RS1(10) = "C" Then
List4.AddItem RS1(0)
End If
RS1.MoveNext
Loop
End If
End If

End Sub

Public Sub CLEAR()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""
Text30.Text = ""
Text31.Text = ""
Text32.Text = ""
Text33.Text = ""
Text34.Text = ""
Text35.Text = ""
Text36.Text = ""
Text37.Text = ""
List1.CLEAR
List1.CLEAR
List2.CLEAR
List3.CLEAR
List4.CLEAR
List5.CLEAR
List6.CLEAR
List7.CLEAR
List8.CLEAR
List10.CLEAR
List6.Enabled = False
List7.Enabled = False
List8.Enabled = False
List9.Enabled = False

End Sub

Private Sub Option7_Click()


If Option7.Value = True Then
ITMS = Option7.Caption
GITEMS
End If

End Sub

Private Sub Option8_Click()


If Option8.Value = True Then
ITMS = Option8.Caption
GITEMS
End If
End Sub

Private Sub Option9_Click()


If Option9.Value = True Then
ITMS = Option9.Caption
GITEMS
End If

End Sub

Private Sub Text1_LostFocus()


If Text1.Text <> "" Then
If CDate(Text1.Text) < Date Then
MsgBox "ERROR IN DATE"
Text1.SetFocus
Else
L = List1.Text
T = CDate(Text1.Text)
DATECHECK
Text2.Text = I
Text3.Text = J
End If
End If

End Sub
Public Sub FRV()
Frame1.Visible = False
Frame2.Visible = False
Frame3.Visible = False
Frame4.Visible = False
Frame5.Visible = False
Frame6.Visible = False
Frame9.Visible = False
Frame10.Visible = False
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Option6.Value = False
Option7.Value = False
Option8.Value = False
Option9.Value = False
Option10.Value = False
Option11.Value = False
Option12.Value = False
End Sub

Public Sub TXTE()


Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Text7.Enabled = False
Text8.Enabled = False
Text9.Enabled = False
Text10.Enabled = False
Text11.Enabled = False
Text12.Enabled = False
Text13.Enabled = False
Text14.Enabled = False
Text15.Enabled = False
Text16.Enabled = False
Text17.Enabled = False
Text18.Enabled = False
Text19.Enabled = False
Text20.Enabled = False
Text21.Enabled = False
Text22.Enabled = False
Text23.Enabled = False
Text24.Enabled = False
Text25.Enabled = False
Text26.Enabled = False
Text27.Enabled = False
Text28.Enabled = False
Text31.Enabled = False
Text32.Enabled = False
Text33.Enabled = False
Text34.Enabled = False
Text35.Enabled = False
Text36.Enabled = False
Text37.Enabled = False

End Sub

Public Sub DATECHECK()


Dim X, Y As Date
If Not RS.BOF Then
RS.MoveFirst
Do While Not RS.EOF
If L = RS(0) Then
I = RS(1)
J = RS(2)
End If
RS.MoveNext
Loop
End If
If Not RS1.BOF Then
RS1.MoveFirst
Do While Not RS1.EOF
If RS1(4) = L Then
X = RS1(7)
Y = DateAdd("d", RS1(6), X)
If ((T >= X) And (T <= Y)) Then
I = I - RS1(5)
End If
End If
RS1.MoveNext
Loop
End If

End Sub

Private Sub Text11_LostFocus()


Dim COUNT As Integer
If Text11.Text <> "" Then
If CDate(Text11.Text) < Date Then
MsgBox "ERROR IN DATE"
Text11.SetFocus
ElseIf List3.Text = "" Then
MsgBox "SELECT ROOM TYPE"
Text11.Text = ""
List3.SetFocus
Else
DAYS = Text10.Text
COUNT = 0
Do While COUNT <= DAYS
T = DateAdd("d", COUNT, Text11.Text)
L = List3.Text
DATECHECK
If I < Val(Text9.Text) Then
MsgBox ("Number Of Rooms Not Availabel For This Date" &
T)
Exit Do
End If
COUNT = COUNT + 1
Loop
If COUNT <= DAYS Then
Text11.SetFocus
Text11.Text = ""
Else
Text12.Text = Time
Text13.Text = Val(Text9.Text) * Val(Text10.Text) * 250
If CDate(Text11.Text) = Date Then
Text28.Text = "C"
Else
Text28.Text = "F"
End If
Image2.Visible = True
End If
End If
End If

End Sub
Public Sub GITEMS()
List6.CLEAR
Text25.Text = ""
If Not RS3.BOF Then
RS3.MoveFirst
Do While Not RS3.EOF
If ITMS = RS3(0) Then
List6.AddItem RS3(1)
End If
RS3.MoveNext
Loop
End If

End Sub

Private Sub Text26_LostFocus()


If Text27.Text = "" Then
AMT = 0
Else
AMT = Val(Text27.Text)
End If
If Text26.Text <> "" Then
List7.AddItem List6.Text
List8.AddItem Text26.Text
List9.AddItem (Val(Text25.Text) * Val(Text26.Text))
Text27.Text = AMT + (Val(Text25.Text) * Val(Text26.Text))
LICOUNT = LICOUNT + 1
Text26.Text = ""
Text26.Enabled = False
Image4.Visible = True
End If

End Sub

Você também pode gostar