Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 149

HOTEL MANAGEMENT SYSTEM

Project Report on
“HOTEL MANAGEMENT SYSTEM”

Submitted by:

HARSHITHA.V(15KUSB7028)
BCA (V Semester)
Academic year 2017-2018

MSRCASC-BCA V SEM Page 1


HOTEL MANAGEMENT SYSTEM

DEPARTMENT OF COMPUTER SCIENCE


CERTIFICATE
This is to certify that HARSHITHA V(15KUSB7028) have successfully
completed the project entitled “HOTEL MANAGEMENT” for 5th semester as
per syllabus prescribed by the Bangalore University for Academic year 2017-
2018.

Mrs.HARI PRIYA Mrs.PRATHIBA.V.K


(Lecturer-in-charge) (Head of Department)

SIGNATURE OF EXAMINERS:

1. 2.

HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 2


ACKNOWLEDGEMENT
This presentation is based on our study and practice during 5th semester of
through we have tried our best for making this project unique in itself, still
flexible at few points. Its’s with pride and deepest sense of gratitude that we
place our profound expression our college “RAMAIAH COLLEGE OF
ARTS, SCIENCE AND COMMERCE” and its illustrations faculty specially
our most respected:

Mrs. Prathiba. V. Kalburgi (H.O.D BCA) for her valuable and inspiring
guidance and encouragement given throughout the period of this project with
reviews, evaluations of our work. We appreciate her immense patience.

Dr. A. Nagarathna (Principal, MRCASC) for providing the right academic


at this institution, which has made this entire task appreciable. We are also
grateful to our friends for their valuable suggestions and words of inspiration
for our project work.

We also grateful to our friends for their valuable suggestion and words of
inspiration for our project work, “HOTEL MANEGEMENT SYSTEM”.

Our sincere thanks to our parents for their co-operation and


encouragement.

MSRCASC-BCA V SEM Page 3


HOTEL MANAGEMENT SYSTEM

ABSTRACT

This document fully and formally describes the requirement of the


proposed said project system. It sets out the functional and non-functional
requirements and includes a description of the user interface and
documentation and training requirements.

An SRS is basically an organization’s understanding (in writing) of a


customer or potential client’s system requirements and dependencies at a
particular point in time (usually) prior to any actual design or development
work. It’s a two-way insurance policy that assures that both the client and
the organization understand the other’s from that perspective at a given
point in time

Earlier everything was hand written and manually done through pen and
paper, and it would take a lot of time also, the work difficult and time
consuming.

So to make the work easy the entire management was changed and there
came into existence a device by the name “Computer”.

This software named “Hotel Management System is fused to manage hotel


transactions and keep records and can be used in any small, medium or
large hotels and offices. The system will guide you through creation of
customer list with all details such as, room information, invoices, booking
slip etc

This software is developed considering all the real time business


transactions which takes place in most of the hotels.

MSRCASC-BCA V SEM Page 4


HOTEL MANAGEMENT SYSTEM

CONTENTS

1. INTRODUCTION

 About Project
 About Hotel Management System

2. SYSTEM ANALYSIS
 Introduction
 Existing System
 Proposed System

3. SYSTEM DESIGN

 Input design
 Output design
 Form design
 Database design

4. SCREEN SHOTS

5. CODING

6. SYSTEM CONFIGURATION

7. CONCLUSION

8. BIBLIOGRAPHY

MSRCASC-BCA V SEM Page 5


HOTEL MANAGEMENT SYSTEM

INTRODUCTION

My project title is HOTEL MANEGEMENT SYSTEM. I have tried my


best to make the complicated process of Hotel Management System as
simple as possible using Structured & Modular technique & Menu
oriented interface. I have tried to design the Project in such a way that
user may not have any difficulty in using this package & further
expansion is possible without much effort. Even though I cannot claim
that this work to entirely exhaustive, the main purpose of my exercise is
perform each Employee’s activity in computerized way rather than
manually which is time consuming.

Administrator can maintain daily updates in the hotel records.


Administrator is must be an authorized user. He can further change the
password. There is the facility for password recovery, logout etc.

The main aim of the entire activity is to automate the process of day to
day activities of Hotel like Room activities, Admission of a New
Customer, Assign a room according to customer’s demand, checkout of a
computer and releasing the room and finally compute the bill etc.

The limited time and resources have restricted us to incorporate, in this


project, only a main activities that are performed in a HOTEL
Management, but utmost care has been taken the system efficient and
user friendly.

“HOTEL Management System” has been designed to computerized the


following functions that are performed by the system:

Room Detail Functions:

Opening s New Room

Check-in and check-out Detail Functions

Admission of New customer Check-in and check-out of customer

MSRCASC-BCA V SEM Page 6


HOTEL MANAGEMENT SYSTEM

Room assigning related to customer’s need.

Statement of Customer Details

Restaurant and Laundry Details

Total number of Customers in the Hotel

Individual customer Report

MSRCASC-BCA V SEM Page 7


HOTEL MANAGEMENT SYSTEM

Hardware and Software Requirements

SOFTWRE REQUIREMENT

 Windows 7 OS
 MS Access
 Visual basic

Windows 7 provides the software “Hotel Management System” a platform through


MS-Office and security through passwords and antivirus.

MS ACESS is helpful in the creativity of the database. A database provides the all the information

to the related topics with helps of the TABLE and Query which is through SQL (structural query

language).

Ms Access is useful because of following causes:-

 MS Access provides data base to the library management system. Ms access


also provides the query .

 It is easy to handle

 It has enough security needed to develop the Hotel Management.

 It is easily available and easy to purchase.

 It is best up to 300000 lines ,which is enough for the library system

MSRCASC-BCA V SEM Page 8


HOTEL MANAGEMENT SYSTEM

VISUAL BASIC provides the view side of the library management system. visual basic
is the front view of the library management.
The main causes of the using the visual basic are as following:-

 It is easy to operate
 It is the best way to deal.
 V.B. provide the front view.
 It easy to purchase

HARDWARE REQUIREMENTS

Hardware required for the library management system is as following:-

 Display Adapter.
 512 MB DDR2 RAM or above.
 X86 Conpatible Processor
 Hard Disk 20 GB or more.

MSRCASC-BCA V SEM Page 9


HOTEL MANAGEMENT SYSTEM

ADVANTAGES OF
“HOTEL MANAGEMENT SYSTEM”

1. PROJECT OBJECTIVE:
To develop a project which will maintain booking of rooms and handle account of a
hotel.

2. PROJECT FEATURES:

HOTEL’S ROOM INFORMATION:


It provides the user to easily search about room’s availability, its type, category & easy
updating of the room’s records.

BILLING FACILITY
Operator, using this project can easily generate the bill for the customer,
He need not make any calculation for it

REPORT GENERATION
This feature help in easy maintenance of record of customer & their
report Generation

PASSWORD PROTECTEDThis feature provide privacy to customer’s


personal detail information.

DIFFERENT LOGIN LEVELS


This feature provide protected login at different
levels.

ADMINISTRATOR:
Administrator can add and delete rooms.

USER
User can do everything except adding & deleting the rooms records.

MSRCASC-BCA V SEM Page 10


HOTEL MANAGEMENT SYSTEM

3. EXTENSIBLITY

3.1 CUSTOMER’S INFORMATION:


Operator has information of customer so as to carry out various activities.

NEW BRANCHES
This feature provides confirm advance booking of room in another branch of that hotel

MSRCASC-BCA V SEM Page 11


HOTEL MANAGEMENT SYSTEM

TEST-CONDITIONS

Sr. Test Condition Pre-requisite Expected Test


No. data Result

1. Check for entry Login form is “Incorrect


in password Opened. User Password”
enters incorrect Message is
password and prompted
presses OK
button
Login form is
2. Check for entry combination of Main form is
in username and correct user name displayed to the
password and password and user, consisting
presses OK of menu options
button enabled.
presses OK
button

3. Check for guest All entries are filled. Message “ room


entries in room is booked”.
booking

4. Invalid Data Type User has entered Warning to enter


the invalid data type. correct data type.

5. Check for guest User has left the Message “ fill all
entries in room entries to be the entries.
booking fulfilled, blank

6. Check entries for User fill entry for Message “ room


adding new room already existing is already
Room. existing”.

MSRCASC-BCA V SEM Page 12


HOTEL MANAGEMENT SYSTEM

LIMITATIONS

1. This project can’t be used for hotel having different branches.

2. This project doesn’t assign unique id to each customer to


distinguish between him or her. Selecting the id from some given
list. However, both the methods of specifying the product are too
vague.

3. This project does not deal with the employee of Hotels such as
clerk, manager etc.

MSRCASC-BCA V SEM Page 13


HOTEL MANAGEMENT SYSTEM

ERROR HANDLING

Error Message Error Correction


no
1 Fill entry Cannot enter Enter numbers ,
properly alphabets and - hyphen,
some special ( Opening
symbols in this bracket or
field ) Closing
Bracket
2 Fill entry Cannot enter Enter only
properly numbers and Alphabets
special symbols
in this field
3 Entry already Duplicate value Enter other unique
existing entered. Cannot Room no.
enter already
existing values in
room add form.
4 Enter LOGIN Enter LOGIN Enter same value in
and and PASSWORD LOGIN and
PASSWORD field do not PASSWORD fields
match.

MSRCASC-BCA V SEM Page 14


HOTEL MANAGEMENT SYSTEM

ADVANTAGES OF VISUAL
PROGRAMMING

 Visual programming enables visual development of graphical user interface,


and easy to use and easy to learn.

 One of the principle advantages is that the programmer need not write code to
display the required component.

 The visual programming environment displays a list of available


component, the programmer pickup the required component from the list.

 The component can be moved resized and even deleted if so required.

 There is no restriction in the number of controls that can be placed moreover


since the programmer is creating the user interface usually we align, move or
size the component as required without having resort to writing code.

MSRCASC-BCA V SEM Page 15


HOTEL MANAGEMENT SYSTEM

SYSTEM DESIGN

Introduction to System Design

Design is the first step into the development phase for any engineered
product or system. Design is a creative process. A good design is the key
to effective system. The term “design” is defined as “the process of
applying various techniques and principles for the purpose of defining a
process or a system in sufficient detail to permit its physical realization”.
It may be defined as a process of applying various techniques and
principles for the purpose of defining a device, a process or a system in
sufficient detail to permit its physical realization. Software design sits at
the technical kernel of the software engineering process and is applied
regardless of the development paradigm that is used. The system design
develops the architectural detail required to build a system or product. As
in the case of any systematic approach, this software too has undergone
the best possible design phase fine tuning all efficiency, performance and
accuracy levels. The design phase is a transition from a user oriented
document to a document to the programmers or database personnel.
System design goes through two phases of development: Logical and
Physical Design.

MSRCASC-BCA V SEM Page 16


HOTEL MANAGEMENT SYSTEM

Input design

The design of input focuses on controlling the amount of input


required, controlling the errors, avoiding delay, avoiding extra steps and
keeping the process simple. The input is designed in such a way so that it
provides security and ease of use with retaining the privacy. Input Design
considered the following things:

 What data should be given as input?


 How the data should be arranged or coded?
 The dialog to guide the operating personnel in providing input.
 Methods for preparing input validations and steps to follow when
error occur.

OUTPUT DESIGN

A quality output is one, which meets the requirements of the end user
and presents the information clearly. In output design it is determined how
the information is to be displaced for immediate need and also the hard
copy output. It is the most important and direct source information to the
user. Efficient and intelligent output design improves the system’s
relationship to help user decision-making.

MSRCASC-BCA V SEM Page 17


HOTEL MANAGEMENT SYSTEM

Designing computer output should proceed in an organized, well thought out


manner; the right output must be developed while ensuring that each output
element is designed so that people will find the system can use easily and
effectively. When analysis design computer output, they should:
 Identify the specific output that is needed to meet the requirements.
 Select methods for presenting information.
 Create document, report, or other formats that contain information
produced by the system.

MSRCASC-BCA V SEM Page 18


HOTEL MANAGEMENT SYSTEM

DISADVANTAGES OF OLD SYSTEM

As we know the manual processing is quite tedious, time consuming, less accurate
in comparison to computerized processing.

Obviously the present system is not exception consultant in counting the entire above
problem.

 Time consuming
 It is very tedious.
 All information are not placed separately.
 Lot of paper work.
 Slow data processing
 Not user-friendly environment
 It is difficult to found record due file management system.

MSRCASC-BCA V SEM Page 19


HOTEL MANAGEMENT SYSTEM

SCREEN
SHOTS

MSRCASC-BCA V SEM Page 20


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 21


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 22


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 23


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 24


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 25


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 26


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 27


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 28


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 29


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 30


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 31


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 32


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 33


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 34


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 35


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 36


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 37


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 38


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 39


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 40


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 41


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 42


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 43


HOTEL MANAGEMENT SYSTEM

CODING

MSRCASC-BCA V SEM Page 44


HOTEL MANAGEMENT SYSTEM

Form Splash :
Private Sub Label6_Click()
End Sub

Private Sub Timer1_Timer()


Label2.Left = Label2.Left + 50
If Label2.Left >= 9930 Then
Label2.Left = 0 - Label2.Width
End If
End Sub

Private Sub Timer2_Timer()


Timer1.Enabled = True
Pb1.Value = Pb1.Value + 1
Label1.Caption = Pb1.Value & "%"
If Pb1.Value = 100 Then
login.Show
Unload Me
End If
End Sub

Login Form :
Dim s1 As String
Dim s2 As String
Private Sub cmdexit_Click()
If MsgBox("Do You Really Want To Exit ?", vbQuestion + vbYesNo +
vbDefaultButton, "WARNING") = vbYes Then
Unload Me
Else
Exit Sub
End If
End Sub

Private Sub Command1_Click()

MSRCASC-BCA V SEM Page 45


HOTEL MANAGEMENT SYSTEM

Form1.Show
End Sub

Private Sub cmdlogin_Click()


If txtusername = "" Then
MsgBox "Enter the username", vbInformation + vbOKOnly, "login"
txtusername.SetFocus
Exit Sub
End If
If txtpassword = "" Then
MsgBox "Enter the password", vbInformation + vbOKOnly, "login"
txtpassword.SetFocus
Exit Sub
End If
s1 = txtusername.Text
s2 = txtpassword.Text
Adodc1.RecordSource = " select * from login where username ='" + s1 + "'
and password='" + s2 + "' "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "Invalid user name and password", vbCritical + vbOKOnly, "login"
Else
menu.Show
Unload login
Exit Sub
End If
txtusername.Text = ""
txtpassword.Text = ""
txtusername.SetFocus

End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
lblDate.Caption = Date
Timer1.Enabled = True
connect
Set rs = New ADODB.Recordset
rs.Source = "login"
MSRCASC-BCA V SEM Page 46
HOTEL MANAGEMENT SYSTEM

rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open

End Sub

Private Sub Labe1_Click()


pchange.Show
End Sub

Private Sub Label1_Click()


account1.Show
End Sub

Private Sub Timer1_Timer()


lbltime.Caption = Format(Now, "hh:mm:ss AM/PM")
lblDate.Caption = Format(Now, "dd-mm-yyyy")
End Sub

Private Sub txtpassword_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
KeyAscii = 0
cmdlogin_Click
End If
End Sub

Private Sub txtusername_Change()

End Sub

Login Password Mismatch:


Private Sub Command1_Click()
If Text2.Text <> Text3.Text Then
MsgBox "password mismatch"
Text2.Text = ""
Text3.Text = ""
Exit Sub
End If

MSRCASC-BCA V SEM Page 47


HOTEL MANAGEMENT SYSTEM

rs.AddNew
rs.Fields(0) = Text1.Text
rs.Fields(1) = Text3.Text
rs.Update
Unload Me
menu.Show

End Sub

Private Sub Command2_Click()


Unload Me

End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
connect

Set rs = New ADODB.Recordset


rs.Source = "Login"
rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open
End Sub

Menu Form :
Private Sub cmdcheckout_Click()
Unload Me
checkout.Show
End Sub

Private Sub cmdcontrolpanel_Click()


ratelist.Show
End Sub
MSRCASC-BCA V SEM Page 48
HOTEL MANAGEMENT SYSTEM

Private Sub cmdlaundry_Click()


laundry.Show
End Sub

Private Sub cmdrestaurant_Click()


Restaurant.Show
End Sub
Private Sub cmdsearch_Click()

searchguest.Show
End Sub
Private Sub Command1_Click()
Unload Me
checkin.Show
End Sub
Private Sub cmdcal_Click()
On Error GoTo Err
Shell "calc.exe", vbNormalFocus
Exit Sub
Err:
MsgBox "You don't have a Calculator installed in your computer.",
vbExclamation, "CSRS version 1"
End Sub
Private Sub cmdlogout_Click()
If MsgBox("Do You Really Want To LogOut ?", vbQuestion + vbYesNo +
vbDefaultButton, "WARNING") = vbYes Then
Unload menu
login.Show
Else
Exit Sub
End If
End Sub
Private Sub cmdnotepad_Click()
On Error GoTo Err
Shell "notepad.exe", vbNormalFocus
Exit Sub
Err:
MsgBox "You don't have a NotePad installed in your computer.",
vbExclamation, "CSRS version 1"
End Sub
MSRCASC-BCA V SEM Page 49
HOTEL MANAGEMENT SYSTEM

Private Sub cmdreservation_Click()

rmenu.Show
End Sub
Private Sub cmdpayment_Click()
payment.Show
End Sub
Private Sub cmdstatus_Click()
status.Show
End Sub
Private Sub Form_Load()
Me.WindowState = vbMaximized
Timer1.Enabled = True
lbldate.Caption = Date

End Sub

Private Sub Label1_Click()

End Sub

Private Sub Timer1_Timer()


lbltime.Caption = Format(Now, "hh:mm:ss Am/Pm")
End Sub

Reservation :
Private Sub cmdadd_Click()

Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
MSRCASC-BCA V SEM Page 50
HOTEL MANAGEMENT SYSTEM

Text19.Text = ""
Combo1.Text = "--SELECT--"
Combo2.Text = "--SELECT--"
Combo3.Text = "--SELECT--"

DTPicker3.Value = Date
On Error GoTo errmsg

Dim id As String
Adodc1.Refresh

If Adodc1.Recordset.RecordCount = 0 Then
id = 1
Adodc1.Recordset.AddNew
Text1.Text = id
Adodc4.Recordset.AddNew
Adodc2.Recordset.AddNew
Adodc3.Recordset.AddNew
rs.AddNew
a.AddNew
Else
Adodc1.Recordset.MoveLast
id = Adodc1.Recordset("Customer_ID") + 1
Adodc1.Recordset.AddNew
Text1.Text = id
Adodc4.Recordset.AddNew
Adodc2.Recordset.AddNew
Adodc3.Recordset.AddNew
rs.AddNew
a.AddNew

Text1.Text = id
End If
Text2.SetFocus

Exit Sub
errmsg:
If Err.Number = "-2147467259" Then
Call MsgBox("CustomerID Already Exist")
End If
End Sub
MSRCASC-BCA V SEM Page 51
HOTEL MANAGEMENT SYSTEM

Private Sub cmdback_Click()


Unload Me
rmenu.Show
End Sub
Private Sub cmdsave_Click()

End Sub

Private Sub Combo2_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Combo2.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

Private Sub cmdsave_Click()


If Text2.Text = "" Or Text3.Text = "" Or Text16.Text = "" Or Text17.Text =
"" Or Text18.Text = "" Or Text19.Text = "" Or Text20.Text = "" Or
Text1.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text8.Text = ""
Or Combo1.Text = "--SELECT--" Or Combo3.Text = "--SELECT--" Then
MsgBox "Please Fill All Complete Details"
Exit Sub
End If
Dim room_type As String
room_type = Combo4.Text
If (room_type = "SINGLE ROOM" And val(Text9.Text) > 1) Then
MsgBox "Standard Room can have only 1 member"
Exit Sub
End If
If (room_type = "STANDARD-ROOM" And val(Text9.Text) > 2) Then
MsgBox "Standard Room can have only 2 member"
Exit Sub
End If
If (room_type = "DELUXE- ROOM" And val(Text9.Text) > 3) Then
MsgBox "Deluxe Room can have only 3 member"
MSRCASC-BCA V SEM Page 52
HOTEL MANAGEMENT SYSTEM

Exit Sub
End If
If (room_type = "SUITE-ROOM" And val(Text9.Text) > 5) Then
MsgBox "Suite Room can have only 5 member"
Exit Sub
End If
Adodc1.Recordset.Fields(0) = Text1.Text
Adodc1.Recordset.Fields(12) = "ACTIVE"
Adodc1.Recordset.Fields(1) = Text2.Text
Adodc1.Recordset.Fields(2) = Combo1.Text
Adodc1.Recordset.Fields(3) = DTPicker1.Value
Adodc1.Recordset.Fields(4) = Text3.Text
Adodc1.Recordset.Fields(5) = Text16.Text
Adodc1.Recordset.Fields(6) = Text17.Text
Adodc1.Recordset.Fields(7) = Text18.Text
Adodc1.Recordset.Fields(8) = Text19.Text
Adodc1.Recordset.Fields(9) = Combo2.Text
Adodc1.Recordset.Fields(10) = Text20.Text
Adodc1.Recordset.Fields(11) = Text4.Text
Adodc1.Recordset.Fields(12) = "BOOKED"

Adodc3.Recordset.Fields(0) = Text1.Text
Adodc3.Recordset.Fields(3) = Text5.Text
Adodc3.Recordset.Fields(2) = Text7.Text
Adodc3.Recordset.Fields(1) = Combo4.Text
Adodc3.Recordset.Fields(4) = Text9.Text

Adodc2.Recordset.Fields(0) = Text1.Text
Adodc2.Recordset.Fields(1) = Text8.Text
Adodc2.Recordset.Fields(7) = Text6.Text
Adodc2.Recordset.Fields(2) = 0
Adodc2.Recordset.Fields(3) = 0
Adodc2.Recordset.Fields(4) = 0
Adodc2.Recordset.Fields(5) = 0
Adodc2.Recordset.Fields(6) = 0
Adodc2.Recordset.Fields(9) = 0
Adodc2.Recordset.Fields(8) = "DUE"

Adodc4.Recordset.Fields(0) = Text1.Text
MSRCASC-BCA V SEM Page 53
HOTEL MANAGEMENT SYSTEM

Adodc4.Recordset.Fields(1) = DTPicker2.Value
Adodc4.Recordset.Fields(2) = Combo3.Text
Adodc4.Recordset.Fields(3) = Text2.Text
Adodc4.Recordset.Fields(5) = Text6.Text
Adodc4.Recordset.Fields(6) = Text5.Text
Adodc4.Recordset.Fields(4) = DTPicker3.Value

rs.Fields(0) = Text1.Text
a.Fields(0) = Text1.Text
a.Fields(1) = "12:00:00 AM"
a.Fields(2) = "18/09/2015"
a.Fields(3) = "12:00:00 AM"
a.Fields(4) = "18/09/2015"
Adodc1.Recordset.Update
Adodc2.Recordset.Update
Adodc3.Recordset.Update
Adodc4.Recordset.Update
rs.Update
a.Update
MsgBox " COUSTOMER BOOKED"

End Sub

Private Sub Combo3_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Combo3.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Combo4_Click()

If Text1.Text = "" Then


MsgBox "PLEASE ADD CUSTOMER FIRST"
Exit Sub
MSRCASC-BCA V SEM Page 54
HOTEL MANAGEMENT SYSTEM

End If

Dim val As String

val = Combo4.Text
Select Case val

Case "SINGLE ROOM"


Label17.Caption = "1"
If Label17.Caption = "1" Then
singleroom1.Show
End If

Case "STANDARD-ROOM"
Label17.Caption = "2"
If Label17.Caption = "2" Then
standardroom1.Show
End If

Case "DELUXE- ROOM"


Label17.Caption = "3"
If Label17.Caption = "3" Then
deluxeroom1.Show
End If
Case "SUITE-ROOM"
Label17.Caption = "4"
If Label17.Caption = "4" Then
suiteroom1.Show
End If
End Select

End Sub

Private Sub Command2_Click()


Set rs9 = New ADODB.Recordset

rs9.Open "select * from Reservation where rid ='" & Text1 & "'", cn, 3, 2

If Not rs.EOF Then


Set DataReport2.DataSource = rs9

MSRCASC-BCA V SEM Page 55


HOTEL MANAGEMENT SYSTEM

DataReport2.Show
End If
End Sub

Private Sub Form_Load()


DTPicker2.Value = Date
connect
Set rs = New ADODB.Recordset
rs.Source = "laundry"
rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open

connect
Set a = New ADODB.Recordset
a.Source = "checkin"
a.ActiveConnection = cn
a.CursorLocation = adUseClient
a.LockType = adLockOptimistic
a.Open

End Sub

Private Sub Label16_Click()


bookinghistory.Show
End Sub

Private Sub Text1_Change()

End Sub

Private Sub Text16_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text16.Text <> "" Then
Text3.SetFocus
ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
MSRCASC-BCA V SEM Page 56
HOTEL MANAGEMENT SYSTEM

End If

End Sub

Private Sub Text17_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text17.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text18_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text2.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text19_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text2.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub text2_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text2.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
MSRCASC-BCA V SEM Page 57
HOTEL MANAGEMENT SYSTEM

(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text20_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text20.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub Text4_Change()


If Len(Text4.Text) > 10 Then
MsgBox "CONTACT NUMBER CONTAIN 10 DIGITS ONLY"
Text4.Text = ""
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text6.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If

End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text5.Text <> "" Then

MSRCASC-BCA V SEM Page 58


HOTEL MANAGEMENT SYSTEM

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text6.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text7.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text8.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub Text9_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text9.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
MSRCASC-BCA V SEM Page 59
HOTEL MANAGEMENT SYSTEM

End Sub

Private Sub Timer1_Timer()


DTPicker2.Value = Format(Now, "dd-mm-yyyy")
DTPicker3.Value = Format(Now, "dd-mm-yyyy")

End Sub

Private Sub Combo3_click()


If Text1.Text = "" Then
MsgBox "PLEASE ADD CUSTOMER FIRST"
Exit Sub
End If

Dim val As String

val = Combo3.Text
Select Case val

Case "SINGLE ROOM"


Label11.Caption = "1"
If Label11.Caption = "1" Then
singleroom.Show
End If

Case "STANDARD-ROOM"
Label11.Caption = "2"
If Label11.Caption = "2" Then
standardroom.Show
End If

Case "DELUXE- ROOM"


Label11.Caption = "3"
If Label11.Caption = "3" Then
deluxeroom.Show
End If
Case "SUITE-ROOM"
Label11.Caption = "4"
If Label11.Caption = "4" Then
MSRCASC-BCA V SEM Page 60
HOTEL MANAGEMENT SYSTEM

suiteroom.Show
End If
End Select
End Sub

Private Sub Command1_Click()


searchguest.Show
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized

DTPicker2.Value = Date
DTPicker3.Value = Time
connect
Set rs = New ADODB.Recordset
rs.Source = "laundry"
rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open

End Sub

Private Sub Text10_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text10.Text <> "" Then
Text11.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If

End Sub
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text11.Text <> "" Then
Text12.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONNLY"
End If
MSRCASC-BCA V SEM Page 61
HOTEL MANAGEMENT SYSTEM

End Sub
Private Sub Text12_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text12.Text <> "" Then
Text13.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub
Private Sub Text13_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text13.Text <> "" Then
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub payment_Change()


If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"
End If
End Sub
Private Sub room_Change()
If room = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else
Adodc1.Recordset.Filter = "[ID] Like '" & room & "'"
End If
End Sub

Private Sub Text14_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text14.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
MSRCASC-BCA V SEM Page 62
HOTEL MANAGEMENT SYSTEM

End If
End Sub

Private Sub Text15_Change()


On Error GoTo errmsg

If Text15 = "" Then


Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_ID] Like '" & Text15 & "'"
Label10.Caption = Adodc4.Recordset.Fields(12)
End If
payment.Caption = Text15.Text
room.Caption = Text15.Text
checkin.Caption = Text15.Text
Exit Sub
errmsg:

If Err.Number = "3021" Then


Text15.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Combo1.Text = "--select--"
Combo2.Text = "--SELECT--"
Combo3.Text = "--SELECT--"
Text10.Text = ""
Text14.Text = ""
Text12.Text = ""
Text13.Text = ""
Call MsgBox("Customer Not exist")

Else
MsgBox Err.Description
MSRCASC-BCA V SEM Page 63
HOTEL MANAGEMENT SYSTEM

End If

End Sub

Private Sub Text15_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text15.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 58 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"

End If

End Sub

Private Sub text2_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text2.Text <> "" Then
Text3.SetFocus
ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text4.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text5.Text <> "" Then

MSRCASC-BCA V SEM Page 64


HOTEL MANAGEMENT SYSTEM

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text6.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text7.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text8.Text <> "" Then
Text9.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub
Private Sub Text9_Change()
MSRCASC-BCA V SEM Page 65
HOTEL MANAGEMENT SYSTEM

If Len(Text9.Text) > 10 Then


MsgBox "CONTACT NUMBER CONTAIN 10 DIGITS ONLY"

End If
End Sub
Private Sub checkin_Change()
On Error GoTo errmsg

If checkin = "" Then


Adodc3.Recordset.Filter = ""

Adodc3.Refresh
Else
Adodc3.Recordset.Filter = "[cid] Like '" & checkin & "'"

Text1.Text = Adodc4.Recordset.Fields(0)
Text2.Text = Adodc4.Recordset.Fields(1)
Combo1.Text = Adodc4.Recordset.Fields(2)
DTPicker1.Value = Adodc4.Recordset.Fields(3)
Text3.Text = Adodc4.Recordset.Fields(4)
Text4.Text = Adodc4.Recordset.Fields(5)
Text5.Text = Adodc4.Recordset.Fields(6)
Text6.Text = Adodc4.Recordset.Fields(7)
Text7.Text = Adodc4.Recordset.Fields(8)
Combo2.Text = Adodc4.Recordset.Fields(9)
Text8.Text = Adodc4.Recordset.Fields(10)
Text9.Text = Adodc4.Recordset.Fields(11)
Text14.Text = Adodc1.Recordset.Fields(4)
Combo3.Text = Adodc1.Recordset.Fields(1)
Text10.Text = Adodc1.Recordset.Fields(2)

Text12.Text = Adodc1.Recordset.Fields(3)

Text13.Text = Adodc2.Recordset.Fields(7)
Exit Sub

DTPicker3.Value = Adodc3.Recordset.Fields(1)
DTPicker2.Value = Adodc3.Recordset.Fields(2)
MSRCASC-BCA V SEM Page 66
HOTEL MANAGEMENT SYSTEM

End If
Exit Sub
errmsg:
MsgBox "DATA NOT FOUND"

End Sub

Private Sub Text9_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text9.Text <> "" Then
Text9.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub Timer1_Timer()


DTPicker2.Value = Format(Now, "dd-mm-yyyy")

End Sub

Private Sub cmdback_Click()


Unload Me
menu.Show
End Sub

Private Sub cmdcheckout_Click()

On Error GoTo errmsg


If Text15.Text = "" Then
MsgBox " Select Customer First"
Exit Sub
End If

If Combo1.Text = "--SELECT--" Then


MsgBox "PLEASE FILL THE REQUIRED FIELDS"
Exit Sub
End If
MSRCASC-BCA V SEM Page 67
HOTEL MANAGEMENT SYSTEM

If Text11.Text = "DUE" Then


MsgBox "must clear all the dues"
Exit Sub
End If

If Label15.Caption = "NOT ACTIVE" Then


MsgBox "CUSTOMER IS NOT ACTIVE"
Exit Sub
End If
Adodc4.Recordset.Fields(12) = "NOT ACTIVE"
Adodc3.Recordset.Fields(3) = DTPicker3.Value
Adodc3.Recordset.Fields(4) = DTPicker2.Value
Adodc1.Recordset.Fields(5) = Combo1.Text
Adodc3.Recordset.Update
Adodc1.Recordset.Update
Adodc4.Recordset.Update
MsgBox "CHECK-OUT RECORD UPDATED"
Exit Sub
errmsg:

End Sub

Private Sub Combo3_click()


Dim val As String

val = Combo3.Text
Select Case val

Case "SINGLE ROOM"


Label11.Caption = "1"
If Label11.Caption = "1" Then
singleroom.Show
End If

Case "STANDARD-ROOM"
Label11.Caption = "2"
If Label11.Caption = "2" Then
MSRCASC-BCA V SEM Page 68
HOTEL MANAGEMENT SYSTEM

standardroom.Show
End If

Case "DELUXE- ROOM"


Label11.Caption = "3"
If Label11.Caption = "3" Then
deluxeroom.Show
End If
Case "SUITE-ROOM"
Label11.Caption = "4"
If Label11.Caption = "4" Then
suiteroom.Show
End If
End Select
End Sub

Private Sub Command1_Click()


searchguest.Show
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
DTPicker2.Value = Date
DTPicker3.Value = Time
End Sub

Private Sub payment_Change()


On Error GoTo errmsg
If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"

Text13.Text = Adodc2.Recordset.Fields(7)
Text11.Text = Adodc2.Recordset.Fields(8)
End If
Exit Sub
errmsg:
MSRCASC-BCA V SEM Page 69
HOTEL MANAGEMENT SYSTEM

End Sub
Private Sub room_Change()
On Error GoTo errmsg
If room = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else
Adodc1.Recordset.Filter = "[ID] Like '" & room & "'"
Combo3.Text = Adodc1.Recordset.Fields(1)
Text10.Text = Adodc1.Recordset.Fields(2)

Text12.Text = Adodc1.Recordset.Fields(3)
Text14.Text = Adodc1.Recordset.Fields(4)

End If
Exit Sub
errmsg:
End Sub
Private Sub Text15_Change()
On Error GoTo errmsg
If Text15 = "" Then
Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_ID] Like '" & Text15 & "'"
Label15.Caption = Adodc4.Recordset.Fields(12)
Text1.Text = Adodc4.Recordset.Fields(0)
Text2.Text = Adodc4.Recordset.Fields(1)
Text16.Text = Adodc4.Recordset.Fields(2)
Text17.Text = Adodc4.Recordset.Fields(3)
Text3.Text = Adodc4.Recordset.Fields(4)
Text4.Text = Adodc4.Recordset.Fields(5)
Text5.Text = Adodc4.Recordset.Fields(6)
Text6.Text = Adodc4.Recordset.Fields(7)
Text7.Text = Adodc4.Recordset.Fields(8)
Text18.Text = Adodc4.Recordset.Fields(9)
Text8.Text = Adodc4.Recordset.Fields(10)
Text9.Text = Adodc4.Recordset.Fields(11)

End If
payment.Caption = Text15.Text
MSRCASC-BCA V SEM Page 70
HOTEL MANAGEMENT SYSTEM

room.Caption = Text15.Text
checkin.Caption = Text15.Text
Exit Sub
errmsg:
If Err.Number = "3021" Then
Text15.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text16.Text = ""
Text18.Text = ""
Text11.Text = ""
Combo1.Text = "--select--"

Combo3.Text = "--SELECT--"
Text10.Text = ""
Text14.Text = ""
Text12.Text = ""
Text13.Text = ""
Call MsgBox("Customer Not exist")

Else
MsgBox Err.Description

End If

End Sub

Private Sub checkin_Change()


On Error GoTo errmsg

If checkin = "" Then


MSRCASC-BCA V SEM Page 71
HOTEL MANAGEMENT SYSTEM

Adodc3.Recordset.Filter = ""

Adodc3.Refresh
Else
Adodc3.Recordset.Filter = "[cid] Like '" & checkin & "'"
DTPicker3.Value = Adodc3.Recordset.Fields(3)
DTPicker2.Value = Adodc3.Recordset.Fields(4)

End If
Exit Sub
errmsg:

End Sub

Private Sub Text15_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text15.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"

End If
End Sub

Private Sub Timer1_Timer()


DTPicker2.Value = Format(Now, "dd-mm-yyyy")
End Sub

Private Sub Command1_Click()


If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "VACANT" Then
checkin.Text10.Text = deluxeroom.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

MSRCASC-BCA V SEM Page 72


HOTEL MANAGEMENT SYSTEM

End If
End If

Unload Me
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub

Private Sub Form_Load()


checkin.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


checkin.Enabled = True

End Sub

Private Sub Command1_Click()


If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "BOOKED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "VACANT" Then
reservation.Text7.Text = deluxeroom1.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

End If
End If
MSRCASC-BCA V SEM Page 73
HOTEL MANAGEMENT SYSTEM

End If

Unload Me
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub

Private Sub Form_Load()


reservation.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


reservation.Enabled = True

End Sub

Private Sub Form_Load()


ProgressBar1.Value = ProgressBar1.Min
End Sub

'Private Sub Timer1_Timer()


'
' If rs.State = 1 Then
' rs.Close
' Else
' rs.Open "select * from Login", cn, adOpenDynamic, adLockOptimistic,
adCmdText
'
' If rs.EOF = True Then
' Unload Me
' account1.Show
' Else
MSRCASC-BCA V SEM Page 74
HOTEL MANAGEMENT SYSTEM

' Unload Me
' login.Show
' End If
' End If
'
'End Sub

Private Sub Timer2_Timer()


ProgressBar1.Value = ProgressBar1.Value + 100
If ProgressBar1.Value = 100 Then
ProgressBar1.Value = ProgressBar1 + 100
If ProgressBar1.Value >= ProgressBar1.Max Then
Timer2.Enabled = False
End If
End If
login.Show
End Sub

Private Sub Timer3_Timer()


Label1.Left = Label1.Left + 50
If Label1.Left >= 9930 Then
Label1.Left = 0 - Label1.Width
End If
End Sub

Option Explicit
Dim operand1 As Double, operand As Double
Dim op1 As Double, op2 As Double
Dim operator As String
Dim cleardisplay As Boolean
Private Sub cmdadd_Click()
If Label2.Caption = "NOT ACTIVE" Then
MsgBox "CUSTOMER IS NOT ACTIVE"
Exit Sub
End If

op1 = val(Text3.Text)
operator = "*"
Dim result1 As Double
MSRCASC-BCA V SEM Page 75
HOTEL MANAGEMENT SYSTEM

op2 = val(Label12.Caption)
result1 = mul(ByVal op1, ByVal op2)
Label10.Caption = result1
op1 = val(Text4.Text)
operator = "*"
Dim result2 As Double
op2 = val(Label15.Caption)
result2 = mul(ByVal op1, ByVal op2)
Label11.Caption = result2
op1 = val(Label10.Caption)
operator = "+"
Dim result3 As Double
op2 = val(Label11.Caption)
result3 = add(ByVal op1, ByVal op2)
Label17.Caption = result3
op1 = val(Label17.Caption)
operator = "+"
Dim result4 As Double
op2 = val(Label16.Caption)
result4 = add(ByVal op1, ByVal op2)
Text5.Text = result4
Dim result5 As Double
op1 = val(Label24.Caption)
operator = "+"
op2 = val(Text3.Text)
result5 = add(ByVal op1, ByVal op2)
Label24.Caption = result5
Dim result6 As Double
op1 = val(Label25.Caption)
operator = "+"
op2 = val(Text4.Text)
result6 = add(ByVal op1, ByVal op2)
Label25.Caption = result6
End Sub
Private Sub cmdback_Click()
Unload Me
menu.Show
End Sub
Private Function mul(ByVal operand1 As Double, ByVal operand2 As
Double) As Double
mul = operand1 * operand2
MSRCASC-BCA V SEM Page 76
HOTEL MANAGEMENT SYSTEM

End Function
Private Function add(ByVal operand1 As Double, ByVal operand2 As
Double) As Double
add = operand1 + operand2
End Function
Private Sub cmdsave_Click()
On Error GoTo errmsg
If Text1.Text = "" Or Text2.Text = "" Or Text6.Text = "" Or Combo1.Text =
"--SELECT--" Then
MsgBox "TRANSACTION NOT ALLOWED,FILL ALL DETAILS"
Exit Sub
End If

Adodc3.Recordset.Fields(1) = Label24.Caption
Adodc3.Recordset.Fields(5) = Combo1.Text
Adodc3.Recordset.Fields(2) = Label25.Caption
Adodc3.Recordset.Fields(3) = DTPicker1.Value
Adodc3.Recordset.Fields(4) = DTPicker2.Value
Adodc2.Recordset.Fields(5) = Text5.Text
Adodc1.Recordset.Update
Adodc2.Recordset.Update
Adodc3.Recordset.Update
MsgBox "TRANSACTION COMPLETE"
Exit Sub
errmsg:
MsgBox Err.Description

End Sub

Private Sub Command1_Click()


searchguest.Show
End Sub

Private Sub Form_Load()


menu.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


MSRCASC-BCA V SEM Page 77
HOTEL MANAGEMENT SYSTEM

menu.Enabled = True

End Sub

Private Sub Label26_Change()


If Label26 = "" Then
Adodc3.Recordset.Filter = ""
Adodc3.Refresh
Else
Adodc3.Recordset.Filter = "[lid] Like '" & Label26 & "'"
End If
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text1.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"
End If
End Sub

Private Sub Text1_Change()


On Error GoTo errmsg
If Text1 = "" Then
Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_ID] Like '" & Text1 & "'"

Text6.Text = Adodc4.Recordset.Fields(1)
Label2.Caption = Adodc4.Recordset.Fields(12)
End If
payment.Caption = Text1.Text
room.Caption = Text1.Text
Label26.Caption = Text1.Text
Exit Sub
errmsg:
If Err.Number = "3021" Then
MSRCASC-BCA V SEM Page 78
HOTEL MANAGEMENT SYSTEM

Text1.Text = ""
Text2.Text = ""
Text6.Text = ""
Label16.Caption = ""
Label17.Caption = ""
Combo1.Text = "--SELECT--"
Call MsgBox("Customer Not exist")
Else
MsgBox Err.Description

End If

End Sub
Private Sub payment_Change()
If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"

Label16.Caption = Adodc2.Recordset.Fields(5)

End If
End Sub
Private Sub room_Change()
If room = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else
Adodc5.Recordset.Filter = "[ID] Like '" & room & "'"
Text2.Text = Adodc5.Recordset.Fields(2)
End If
End Sub

Private Sub Command1_Click()


Unload Me
ratelist.Show
End Sub
Private Sub Command2_Click()
If Option1.Value = True Then
MSRCASC-BCA V SEM Page 79
HOTEL MANAGEMENT SYSTEM

Adodc1.Recordset.Fields(0) = Text1.Text
Adodc1.Recordset.Update
Else
If Option2.Value = True Then
Adodc1.Recordset.Fields(1) = Text1.Text
Adodc1.Recordset.Update
Else
End If
End If
End Sub

Dim s1 As String
Dim s2 As String
Private Sub cmdexit_Click()
If MsgBox("Do You Really Want To Exit ?", vbQuestion + vbYesNo +
vbDefaultButton, "WARNING") = vbYes Then
Unload Me
Else
Exit Sub
End If
End Sub

Private Sub Command1_Click()


Form1.Show
End Sub

Private Sub cmdlogin_Click()


If txtusername = "" Then
MsgBox "Enter the password", vbInformation + vbOKOnly, "login"
txtusername.SetFocus
Exit Sub
End If
If txtpassword = "" Then
MsgBox "Enter the password", vbInformation + vbOKOnly, "login"
txtpassword.SetFocus
Exit Sub
End If
s1 = txtusername.Text
s2 = txtpassword.Text
MSRCASC-BCA V SEM Page 80
HOTEL MANAGEMENT SYSTEM

Adodc1.RecordSource = " select * from login where username ='" + s1 + "'


and password='" + s2 + "' "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "Invalid user name and password", vbCritical + vbOKOnly, "login"
Else
menu.Show
Unload login
Exit Sub
End If
txtusername.Text = ""
txtpassword.Text = ""
txtusername.SetFocus

End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
lbldate.Caption = Date
Timer1.Enabled = True
connect
Set rs = New ADODB.Recordset
rs.Source = "login"
rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open

End Sub

Private Sub Labe1_Click()


pchange.Show
End Sub
Private Sub Timer1_Timer()
lbltime.Caption = Format(Now, "hh:mm:ss AM/PM")
lbldate.Caption = Format(Now, "dd-mm-yyyy")
End Sub

Private Sub txtpassword_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
MSRCASC-BCA V SEM Page 81
HOTEL MANAGEMENT SYSTEM

KeyAscii = 0
cmdlogin_Click
End If
End Sub

Private Sub cmdcheckout_Click()


Unload Me
checkout.Show
End Sub

Private Sub cmdcontrolpanel_Click()


ratelist.Show
End Sub

Private Sub cmdlaundry_Click()


laundry.Show
End Sub

Private Sub cmdrestaurant_Click()


Restaurant.Show
End Sub
Private Sub cmdsearch_Click()

searchguest.Show
End Sub
Private Sub Command1_Click()
Unload Me
checkin.Show
End Sub
Private Sub cmdcal_Click()
On Error GoTo Err
Shell "calc.exe", vbNormalFocus
Exit Sub
Err:
MsgBox "You don't have a Calculator installed in your computer.",
vbExclamation, "CSRS version 1"
End Sub
Private Sub cmdlogout_Click()
If MsgBox("Do You Really Want To LogOut ?", vbQuestion + vbYesNo +
vbDefaultButton, "WARNING") = vbYes Then
MSRCASC-BCA V SEM Page 82
HOTEL MANAGEMENT SYSTEM

Unload menu
login.Show
Else
Exit Sub
End If
End Sub
Private Sub cmdnotepad_Click()
On Error GoTo Err
Shell "notepad.exe", vbNormalFocus
Exit Sub
Err:
MsgBox "You don't have a NotePad installed in your computer.",
vbExclamation, "CSRS version 1"
End Sub
Private Sub cmdreservation_Click()

rmenu.Show
End Sub
Private Sub cmdpayment_Click()
payment.Show
End Sub
Private Sub cmdstatus_Click()
status.Show
End Sub
Private Sub Form_Load()
Me.WindowState = vbMaximized
Timer1.Enabled = True
lbldate.Caption = Date

End Sub

Private Sub Timer1_Timer()


lbltime.Caption = Format(Now, "hh:mm:ss Am/Pm")
End Sub

Private Sub checkin_Change()


If checkin = "" Then
Adodc6.Recordset.Filter = ""
Adodc6.Refresh
Else
Adodc6.Recordset.Filter = "[cid] Like '" & checkin & "'"
MSRCASC-BCA V SEM Page 83
HOTEL MANAGEMENT SYSTEM

Label11.Caption = Adodc6.Recordset.Fields(2)

End If
End Sub

Private Sub cmdback_Click()


Unload Me
menu.Show
End Sub

Private Sub CMDCALCULATE_Click()

If Label6.Caption = "NOT ACTIVE" Then


MsgBox "CUSTOMER IS NOT ACTIVE"
Exit Sub
End If
If Text5.Text = "" Or Text6.Text = "" Then
MsgBox " PLEASE ENTER EXTRA CHARGE ,DISCOUNT"
Exit Sub
End If
Dim i As Double
If Len(Text14) = 11 Then
Adodc3.Refresh
i = Adodc3.Recordset("singleroom") * val(Text9.Text)
Text13.Text = i
End If
Dim a As Double
If Len(Text14) = 10 Then
Adodc3.Refresh
a = Adodc3.Recordset("suitroom") * val(Text9.Text)
Text13.Text = a
End If
Dim b As Double
If Len(Text14) = 12 Then
Adodc3.Refresh
b = Adodc3.Recordset("deluxroom") * val(Text9.Text)
Text13.Text = b
End If
Dim c As Double
If Len(Text14) = 13 Then
MSRCASC-BCA V SEM Page 84
HOTEL MANAGEMENT SYSTEM

Adodc3.Refresh
c = Adodc3.Recordset("standardroom") * val(Text9.Text)
Text13.Text = c
End If
Dim tot As Double
tot = val(Text5) + val(Text6) + val(Text10) + val(Text11) + val(Text13)
Text7.Text = val(tot) + (4 / 100) * val(tot)
Text15.Text = (4 / 100) * val(tot)
Dim bal As Double
bal = val(tot) - val(Text4) + val(Text15.Text)
Text8.Text = val(bal)

End Sub

Private Sub Command1_Click()


Set rs = New ADODB.Recordset

rs.Open "select * from Paymentlog where Customer_ID ='" & Text1 & "'",
cn, 3, 2

If Not rs.EOF Then


Set DataReport1.DataSource = rs

DataReport1.Show
End If
End Sub

Private Sub Command2_Click()

If Text5.Text = "" Or Text6.Text = "" Or Combo1.Text = "--SELECT--"


Then
MsgBox " PLEASE ENTER EXTRA CHARGE ,DISCOUNT STATUS "

Exit Sub
End If

Adodc2.Recordset.Fields(1) = Text6.Text
Adodc2.Recordset.Fields(2) = Text5.Text
Adodc2.Recordset.Fields(3) = Text8.Text
Adodc2.Recordset.Fields(6) = Text7.Text
Adodc2.Recordset.Fields(8) = Combo1.Text
MSRCASC-BCA V SEM Page 85
HOTEL MANAGEMENT SYSTEM

Adodc2.Recordset.Fields(9) = Text13.Text
Adodc1.Recordset.Fields(3) = Text9.Text

Adodc2.Recordset.Fields(10) = Text15.Text

Adodc5.Recordset.AddNew

Adodc5.Recordset.Fields(1) = Text1.Text
Adodc5.Recordset.Fields(2) = Text2.Text
Adodc5.Recordset.Fields(3) = Text13.Text
Adodc5.Recordset.Fields(5) = Text6.Text
Adodc5.Recordset.Fields(6) = Text5.Text
Adodc5.Recordset.Fields(7) = Text10.Text
Adodc5.Recordset.Fields(8) = Text11.Text
Adodc5.Recordset.Fields(9) = Text7.Text
Adodc5.Recordset.Fields(10) = Combo1.Text
Adodc5.Recordset.Fields(11) = Text9.Text
Adodc5.Recordset.Fields(12) = Combo1.Text
Adodc5.Recordset.Fields(13) = Text3.Text
Adodc5.Recordset.Fields(14) = Label14.Caption
Adodc5.Recordset.Fields(15) = Text8.Text
Adodc5.Recordset.Fields(4) = Text4.Text
Adodc5.Recordset.Fields(16) = Text15.Text
Adodc5.Recordset.Update
Adodc2.Recordset.Update
Adodc1.Recordset.Update

MsgBox " PAYMENT DONE"

End Sub

Private Sub Command3_Click()


searchguest.Show
End Sub

Private Sub Form_Load()


menu.Enabled = False
Label14.Caption = Date
Timer1.Enabled = True
connect
MSRCASC-BCA V SEM Page 86
HOTEL MANAGEMENT SYSTEM

Set rs = New ADODB.Recordset


rs.Source = "Payment"
rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open
End Sub

Private Sub Timer1_Timer()


DTPicker2.Value = Format(Now, "dd-mm-yyyy")

End Sub

payment.Caption = Text1.Text
End Sub

Private Sub Text22_Change()


On Error GoTo errmsg
If Text22 = "" Then
Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_Name] Like '*" & Text22 & "*'"

Text1.Text = Adodc4.Recordset.Fields(0)
Text2.Text = Adodc4.Recordset.Fields(1)
Text3.Text = Adodc4.Recordset.Fields(2)
Text4.Text = Adodc4.Recordset.Fields(3)
Text5.Text = Adodc4.Recordset.Fields(4)
Text6.Text = Adodc4.Recordset.Fields(5)
Text7.Text = Adodc4.Recordset.Fields(6)
Text8.Text = Adodc4.Recordset.Fields(7)
Text9.Text = Adodc4.Recordset.Fields(8)
Text10.Text = Adodc4.Recordset.Fields(9)
Text11.Text = Adodc4.Recordset.Fields(10)
Text12.Text = Adodc4.Recordset.Fields(11)

Label10.Caption = Adodc4.Recordset.Fields(12)

Text13.Text = Adodc1.Recordset.Fields(1)
MSRCASC-BCA V SEM Page 87
HOTEL MANAGEMENT SYSTEM

Text14.Text = Adodc1.Recordset.Fields(2)

Text23.Text = Adodc1.Recordset.Fields(4)

Text17.Text = Adodc2.Recordset.Fields(7)

Text18.Text = Adodc3.Recordset.Fields(1)
Text19.Text = Adodc3.Recordset.Fields(2)

Text20.Text = Adodc3.Recordset.Fields(3)
Text21.Text = Adodc3.Recordset.Fields(4)

End If
Exit Sub
errmsg:
If Err.Number = "3021" Then
Text22.Text = ""
Call MsgBox("Customer Not exist")

Else
MsgBox Err.Description

End If

End Sub

Private Sub Text22_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text22.Text <> "" Then
Text3.SetFocus
ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If
End Sub

Private Sub Command1_Click()

If Label4.Caption = "ALLOTED" Then


MsgBox "ROOM IS NOT VACANT"
MSRCASC-BCA V SEM Page 88
HOTEL MANAGEMENT SYSTEM

Exit Sub
Else
If Label4.Caption = "VACANT" Then
Adodc1.Recordset.Fields(1) = Label1.Caption
checkin.Text10.Text = singleroom.Label3.Caption

End If
End If
Unload Me

End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub
Private Sub Form_Load()
checkin.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


checkin.Enabled = True

End Sub

Private Sub Command1_Click()


If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "BOOKED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "VACANT" Then
Adodc1.Recordset.Fields(1) = Label1.Caption
reservation.Text7.Text = singleroom1.Label3.Caption

End If
MSRCASC-BCA V SEM Page 89
HOTEL MANAGEMENT SYSTEM

End If
End If

Unload Me

End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub

Private Sub Form_Load()


reservation.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


reservation.Enabled = True

End Sub

Private Sub Command1_Click()


If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "VACANT" Then
checkin.Text10.Text = standardroom.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

End If
End If

Unload Me
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
MSRCASC-BCA V SEM Page 90
HOTEL MANAGEMENT SYSTEM

Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub

Private Sub Form_Load()


checkin.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


checkin.Enabled = True

End Sub

Private Sub Command1_Click()


If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "BOOK" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else

If Label4.Caption = "VACANT" Then


reservation.Text7.Text = standardroom1.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

End If
End If
End If

Unload Me
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub
MSRCASC-BCA V SEM Page 91
HOTEL MANAGEMENT SYSTEM

Private Sub Form_Load()


reservation.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


reservation.Enabled = True

End Sub

Public a As String
Private Sub cmdback_Click()
Unload Me
menu.Show
End Sub

Private Sub Form_Load()

menu.Enabled = False

a = Label16.Caption
b = Label23.Caption
Label2.Caption = Adodc1.Recordset.RecordCount
Label3.Caption = Adodc2.Recordset.RecordCount
Label4.Caption = Adodc3.Recordset.RecordCount
Label5.Caption = Adodc4.Recordset.RecordCount

Label1.Caption = val(Label2.Caption) + val(Label3.Caption) +


val(Label4.Caption) + val(Label5.Caption)

Adodc1.RecordSource = " select * from singleroom where status ='" + a + "'


"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Label7.Caption = "0"
Else
Label7.Caption = Adodc1.Recordset.RecordCount
End If
MSRCASC-BCA V SEM Page 92
HOTEL MANAGEMENT SYSTEM

Adodc1.RecordSource = " select * from singleroom where status ='" + b + "'


"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Label19.Caption = "0"
Else
Label19.Caption = Adodc1.Recordset.RecordCount
End If

Adodc2.RecordSource = " select * from standardroom where status ='" + a +


"' "
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
Label8.Caption = "0"
Else
Label8.Caption = Adodc2.Recordset.RecordCount
End If

Adodc2.RecordSource = " select * from standardroom where status ='" + b +


"' "
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
Label20.Caption = "0"
Else
Label20.Caption = Adodc2.Recordset.RecordCount
End If

Adodc3.RecordSource = " select * from suitroom where status ='" + a + "' "
Adodc3.Refresh
If Adodc3.Recordset.RecordCount = 0 Then
Label9.Caption = "0"
Else
Label9.Caption = Adodc3.Recordset.RecordCount
End If

Adodc3.RecordSource = " select * from suitroom where status ='" + b + "' "
Adodc3.Refresh
MSRCASC-BCA V SEM Page 93
HOTEL MANAGEMENT SYSTEM

If Adodc3.Recordset.RecordCount = 0 Then
Label21.Caption = "0"
Else
Label21.Caption = Adodc3.Recordset.RecordCount
End If

Adodc4.RecordSource = " select * from deluxroom where status ='" + a + "'


"
Adodc4.Refresh
If Adodc4.Recordset.RecordCount = 0 Then
Label10.Caption = "0"
Else
Label10.Caption = Adodc4.Recordset.RecordCount

End If

Adodc4.RecordSource = " select * from deluxroom where status ='" + b + "'


"
Adodc4.Refresh
If Adodc4.Recordset.RecordCount = 0 Then
Label22.Caption = "0"
Else
Label22.Caption = Adodc4.Recordset.RecordCount

End If

Label6.Caption = val(Label7.Caption) + val(Label8.Caption) +


val(Label9.Caption) + val(Label10.Caption)

Label18.Caption = val(Label19.Caption) + val(Label20.Caption) +


val(Label21.Caption) + val(Label22.Caption)

Label12.Caption = val(Label2.Caption) - (val(Label7.Caption) +


val(Label19.Caption))

Label13.Caption = val(Label3.Caption) - (val(Label8.Caption) +


val(Label20.Caption))
Label14.Caption = val(Label4.Caption) - (val(Label9.Caption) +
val(Label21.Caption))
MSRCASC-BCA V SEM Page 94
HOTEL MANAGEMENT SYSTEM

Label15.Caption = val(Label5.Caption) - (val(Label10.Caption) +


val(Label21.Caption))
Label11.Caption = val(Label12.Caption) + val(Label13.Caption) +
val(Label14.Caption) + val(Label15.Caption)

End Sub

Private Sub Form_Unload(Cancel As Integer)


menu.Enabled = True
End Sub

Private Sub Command1_Click()


If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "VACANT" Then
checkin.Text10.Text = suiteroom.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

End If
End If

Unload Me
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub
Private Sub Form_Load()
checkin.Enabled = False

End Sub

MSRCASC-BCA V SEM Page 95


HOTEL MANAGEMENT SYSTEM

Private Sub Form_Unload(Cancel As Integer)


checkin.Enabled = True

End Sub

Private Sub Command1_Click()


If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "BOOK" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "VACANT" Then
reservation.Text7.Text = suiteroom.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

End If
End If
End If

Unload Me
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub

Private Sub Form_Load()


reservation.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


reservation.Enabled = True

End Sub
MSRCASC-BCA V SEM Page 96
HOTEL MANAGEMENT SYSTEM

Single Room :
Private Sub Command1_Click()

If Label4.Caption = "ALLOTED" Then


MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "VACANT" Then
Adodc1.Recordset.Fields(1) = Label1.Caption
checkin.Text10.Text = singleroom.Label3.Caption

End If
End If
Unload Me

End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub
Private Sub Form_Load()
checkin.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


checkin.Enabled = True

End Sub

Standard Room :
Private Sub Command1_Click()
If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"

MSRCASC-BCA V SEM Page 97


HOTEL MANAGEMENT SYSTEM

Exit Sub
Else
If Label4.Caption = "VACANT" Then
checkin.Text10.Text = standardroom.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

End If
End If

Unload Me
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub

Private Sub Form_Load()


checkin.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


checkin.Enabled = True

End Sub

Suite Room :
Private Sub Command1_Click()
If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
MSRCASC-BCA V SEM Page 98
HOTEL MANAGEMENT SYSTEM

If Label4.Caption = "VACANT" Then


checkin.Text10.Text = suiteroom.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

End If
End If

Unload Me
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub
Private Sub Form_Load()
checkin.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


checkin.Enabled = True

End Sub

Deluxe Room :
Private Sub Command1_Click()
If Label4.Caption = "ALLOTED" Then
MsgBox "ROOM IS NOT VACANT"
Exit Sub
Else
If Label4.Caption = "VACANT" Then
checkin.Text10.Text = deluxeroom.Label3.Caption
Adodc1.Recordset.Fields(1) = Label1.Caption

End If
End If

Unload Me
MSRCASC-BCA V SEM Page 99
HOTEL MANAGEMENT SYSTEM

End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Fields(1) = Label2.Caption
Adodc1.Recordset.Update
MsgBox "ROOM DEALLOTED"
End Sub

Private Sub Form_Load()


checkin.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


checkin.Enabled = True

End Sub

Booking History :
Private Sub Command1_Click()
searchguest.Show
End Sub

Private Sub Command2_Click()


Unload Me
menu.Show

End Sub

Private Sub Form_Load()

Me.filllistview

End Sub

Sub filllistview()

MSRCASC-BCA V SEM Page 100


HOTEL MANAGEMENT SYSTEM

rs4.Open "select * from custinfo inner join Reservation on


custinfo.Customer_ID = Reservation.rid", cn, 3, 2

If Not rs4.EOF Then


ListView1.ListItems.Clear
rs4.MoveFirst
Do While Not rs4.EOF

Set Item = ListView1.ListItems.add(, , rs4!Customer_ID)


Item.SubItems(1) = rs4!Customer_Name
Item.SubItems(2) = rs4!bookingdate
Item.SubItems(3) = rs4!bookingvia
rs4.MoveNext

Loop
Else
ListView1.ListItems.Clear
End If
rs4.Close
Set rs4 = Nothing

End Sub

Private Sub Text1_Change()


rs4.Open "select * from custinfo inner join Reservation on
custinfo.Customer_ID = Reservation.rid where Customer_ID like '" &
Text1.Text & "' ", cn, 3, 2
If Not rs4.EOF Then
ListView1.ListItems.Clear
rs4.MoveFirst
Do While Not rs4.EOF

Set Item = ListView1.ListItems.add(, , rs4!Customer_ID)


Item.SubItems(1) = rs4!Customer_Name
Item.SubItems(2) = rs4!bookingdate
Item.SubItems(3) = rs4!bookingvia
rs4.MoveNext

MSRCASC-BCA V SEM Page 101


HOTEL MANAGEMENT SYSTEM

Loop
Else
ListView1.ListItems.Clear
End If
rs4.Close
Set rs4 = Nothing
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text1.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"

End If
End Sub

Cancel Registration :
Private Sub Combo4_Click()
Dim val As String

val = Combo4.Text
Select Case val

Case "SINGLE ROOM"


Label11.Caption = "1"
If Label11.Caption = "1" Then
singleroom1.Show
End If

Case "STANDARD-ROOM"
Label11.Caption = "2"
If Label11.Caption = "2" Then
standardroom1.Show
End If

Case "DELUXE- ROOM"


Label11.Caption = "3"
MSRCASC-BCA V SEM Page 102
HOTEL MANAGEMENT SYSTEM

If Label11.Caption = "3" Then


deluxeroom1.Show
End If
Case "SUITE-ROOM"
Label11.Caption = "4"
If Label11.Caption = "4" Then
suiteroom1.Show
End If
End Select
End Sub

Private Sub Command1_Click()


On Error GoTo errmsg
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text5.Text = ""
Or Text6.Text = "" Or Text7.Text = "" Then
MsgBox "SELECT THE CUSTOMER FIRST"
Exit Sub
End If
Dim wish As Integer
wish = MsgBox("do you really want to cancel (y/n)?", vbYesNo +
vbQuestion + vbDefaultButton1)
If wish = vbYes Then
Adodc1.Recordset.Delete
Adodc2.Recordset.Delete
Adodc3.Recordset.Delete
Adodc4.Recordset.Delete
Adodc5.Recordset.Delete
Adodc6.Recordset.Delete

MsgBox "RESERVATION CANCELLED SUCESSFULLY"


End If

Exit Sub
errmsg:
MsgBox "ENTER THE NAME OF CUSTOMER "
End Sub

Private Sub checkin_Change()


If checkin = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
MSRCASC-BCA V SEM Page 103
HOTEL MANAGEMENT SYSTEM

Else
Adodc2.Recordset.Filter = "[cid] Like '" & checkin & "'"

End If
End Sub

Private Sub Command2_Click()


searchguest.Show
End Sub

Private Sub Command3_Click()


Unload Me
rmenu.Show
End Sub

Private Sub laundry_Change()


If laundry = "" Then
Adodc3.Recordset.Filter = ""
Adodc3.Refresh
Else
Adodc3.Recordset.Filter = "[lid] Like '" & laundry & "'"
End If
End Sub

Private Sub reservation_Change()


If reservation = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else
Adodc1.Recordset.Filter = "[Customer_ID] Like '" & reservation & "'"
End If
End Sub

Private Sub room_Change()


If room = "" Then
Adodc5.Recordset.Filter = ""
Adodc5.Refresh
Else
Adodc5.Recordset.Filter = "[ID] Like '" & room & "'"
Combo4.Text = Adodc5.Recordset.Fields(1)
Text5.Text = Adodc5.Recordset.Fields(2)
MSRCASC-BCA V SEM Page 104
HOTEL MANAGEMENT SYSTEM

End If
End Sub

Private Sub Text1_Change()


On Error GoTo errmsg
If Text1 = "" Then
Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[rid] Like '" & Text1 & "'"
Text2.Text = Adodc4.Recordset.Fields(0)
Text3.Text = Adodc4.Recordset.Fields(3)
Text7.Text = Adodc4.Recordset.Fields(2)

End If
payment.Caption = Text1.Text
room.Caption = Text2.Text
reservation.Caption = Text1.Text
laundry.Caption = Text1.Text
checkin.Caption = Text1.Text

Exit Sub
errmsg:
If Err.Number = "3021" Then
Call MsgBox("Customer Not exist")
Else
MsgBox Err.Description

End If

End Sub

Private Sub payment_Change()


If payment = "" Then
Adodc6.Recordset.Filter = ""
Adodc6.Refresh
Else
Adodc6.Recordset.Filter = "[PID] Like '" & payment & "'"
Text6.Text = Adodc6.Recordset.Fields(7)
End If
End Sub
MSRCASC-BCA V SEM Page 105
HOTEL MANAGEMENT SYSTEM

Private Sub Text1_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text6.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Check in :
Private Sub ccmdclear_Click()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Combo1.Text = "--select--"
Combo2.Text = "--SELECT--"
Combo3.Text = "--SELECT--"
Text10.Text = ""
Text14.Text = ""
Text12.Text = ""
Text13.Text = ""
End Sub

Private Sub cmdadd_Click()


Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Combo1.Text = "--select--"
MSRCASC-BCA V SEM Page 106
HOTEL MANAGEMENT SYSTEM

Combo2.Text = "--SELECT--"
Combo3.Text = "--SELECT--"
Text10.Text = ""
Text14.Text = ""
Text12.Text = ""
Text13.Text = ""
On Error GoTo errmsg

Dim id As String

Adodc4.Refresh
Adodc4.Recordset.MoveLast

id = Adodc4.Recordset("Customer_ID") + 1
Adodc4.Recordset.AddNew
Adodc1.Recordset.AddNew
Adodc2.Recordset.AddNew
Adodc3.Recordset.AddNew
rs.AddNew
Text1.Text = id
Text2.SetFocus

Exit Sub
errmsg:

If Err.Number = "-2147467259" Then


Call MsgBox("CustomerID Already Exist")
Exit Sub
End If

Adodc4.Recordset.AddNew
Adodc1.Recordset.AddNew
Adodc2.Recordset.AddNew
Adodc3.Recordset.AddNew
rs.AddNew
Text1.Text = 1
Text2.SetFocus

End Sub

Private Sub cmdback_Click()


MSRCASC-BCA V SEM Page 107
HOTEL MANAGEMENT SYSTEM

Unload Me
menu.Show
End Sub
Private Sub cmdcheckin_Click()
On Error GoTo errmsg
If Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = ""
Or Text6.Text = "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text =
"" Or Text10.Text = "" Or Text12.Text = "" Or Text13.Text = "" Then
MsgBox "field should not be left blank"
Exit Sub
End If
Adodc4.Recordset.Fields(0) = Text1.Text
Adodc4.Recordset.Fields(1) = Text2.Text
Adodc4.Recordset.Fields(2) = Combo1.Text
Adodc4.Recordset.Fields(3) = DTPicker1.Value
Adodc4.Recordset.Fields(4) = Text3.Text
Adodc4.Recordset.Fields(5) = Text4.Text
Adodc4.Recordset.Fields(6) = Text5.Text
Adodc4.Recordset.Fields(7) = Text6.Text
Adodc4.Recordset.Fields(8) = Text7.Text
Adodc4.Recordset.Fields(9) = Combo2.Text
Adodc4.Recordset.Fields(10) = Text8.Text
Adodc4.Recordset.Fields(11) = Text9.Text
Adodc4.Recordset.Fields(12) = "ACTIVE"
Adodc1.Recordset.Fields(0) = Text1.Text
Adodc1.Recordset.Fields(1) = Combo3.Text
Adodc1.Recordset.Fields(2) = Text10.Text

Adodc1.Recordset.Fields(3) = Text12.Text
Adodc1.Recordset.Fields(4) = Text14.Text
Adodc2.Recordset.Fields(0) = Text1.Text
Adodc2.Recordset.Fields(1) = 0
Adodc2.Recordset.Fields(2) = 0
Adodc2.Recordset.Fields(3) = 0
Adodc2.Recordset.Fields(4) = 0
Adodc2.Recordset.Fields(5) = 0
Adodc2.Recordset.Fields(6) = 0
Adodc2.Recordset.Fields(9) = 0
Adodc2.Recordset.Fields(10) = 0

Adodc2.Recordset.Fields(8) = "DUE"
MSRCASC-BCA V SEM Page 108
HOTEL MANAGEMENT SYSTEM

Adodc2.Recordset.Fields(7) = Text13.Text
Adodc3.Recordset.Fields(0) = Text1.Text
Adodc3.Recordset.Fields(1) = DTPicker3.Value
Adodc3.Recordset.Fields(2) = DTPicker2.Value
Adodc3.Recordset.Fields(3) = "00:00:00 AM"
Adodc3.Recordset.Fields(4) = "1/1/2012"
rs.Fields(0) = Text1.Text
rs.Fields(1) = 0
rs.Fields(2) = 0
rs.Fields(3) = "1/1/2012"
rs.Fields(4) = "1/1/2012"
rs.Fields(5) = "--SELECT--"
Adodc1.Recordset.Update
Adodc2.Recordset.Update
Adodc3.Recordset.Update
Adodc4.Recordset.Update
rs.Update
MsgBox "RECORD SAVED SUCCESSFULLY"

Exit Sub
errmsg:
MsgBox Err.Description
Exit Sub
End Sub

Private Sub Combo1_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Combo1.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "PLEASE SELECT THE GENDER"
End If

End Sub

Private Sub Combo2_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Combo2.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
MSRCASC-BCA V SEM Page 109
HOTEL MANAGEMENT SYSTEM

KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Combo3_click()


If Text1.Text = "" Then
MsgBox "PLEASE ADD CUSTOMER FIRST"
Exit Sub
End If

Dim val As String

val = Combo3.Text
Select Case val

Case "SINGLE ROOM"


Label11.Caption = "1"
If Label11.Caption = "1" Then
singleroom.Show
End If

Case "STANDARD-ROOM"
Label11.Caption = "2"
If Label11.Caption = "2" Then
standardroom.Show
End If

Case "DELUXE- ROOM"


Label11.Caption = "3"
If Label11.Caption = "3" Then
deluxeroom.Show
End If
Case "SUITE-ROOM"
Label11.Caption = "4"
If Label11.Caption = "4" Then
suiteroom.Show
End If
End Select
MSRCASC-BCA V SEM Page 110
HOTEL MANAGEMENT SYSTEM

End Sub

Private Sub Command1_Click()


searchguest.Show
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized

DTPicker2.Value = Date
DTPicker3.Value = Time
connect
Set rs = New ADODB.Recordset
rs.Source = "laundry"
rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open

End Sub

Private Sub Text10_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text10.Text <> "" Then
Text11.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If

End Sub
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text11.Text <> "" Then
Text12.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONNLY"
End If
End Sub
Private Sub Text12_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text12.Text <> "" Then
MSRCASC-BCA V SEM Page 111
HOTEL MANAGEMENT SYSTEM

Text13.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub
Private Sub Text13_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text13.Text <> "" Then
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub payment_Change()


If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"
End If
End Sub
Private Sub room_Change()
If room = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else
Adodc1.Recordset.Filter = "[ID] Like '" & room & "'"
End If
End Sub

Private Sub Text14_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text14.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

MSRCASC-BCA V SEM Page 112


HOTEL MANAGEMENT SYSTEM

Private Sub Text15_Change()


On Error GoTo errmsg

If Text15 = "" Then


Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_ID] Like '" & Text15 & "'"
Label10.Caption = Adodc4.Recordset.Fields(12)
End If
payment.Caption = Text15.Text
room.Caption = Text15.Text
checkin.Caption = Text15.Text
Exit Sub
errmsg:

If Err.Number = "3021" Then


Text15.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Combo1.Text = "--select--"
Combo2.Text = "--SELECT--"
Combo3.Text = "--SELECT--"
Text10.Text = ""
Text14.Text = ""
Text12.Text = ""
Text13.Text = ""
Call MsgBox("Customer Not exist")

Else
MsgBox Err.Description

End If

MSRCASC-BCA V SEM Page 113


HOTEL MANAGEMENT SYSTEM

End Sub

Private Sub Text15_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text15.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 58 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"

End If

End Sub

Private Sub text2_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text2.Text <> "" Then
Text3.SetFocus
ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text4.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text5.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
MSRCASC-BCA V SEM Page 114
HOTEL MANAGEMENT SYSTEM

End If

End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text6.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text7.Text <> "" Then

ElseIf (KeyAscii < 65 And KeyAscii <> 8 And KeyAscii <> 32) Or
(KeyAscii > 90 And KeyAscii < 97) Or (KeyAscii > 122) Then
KeyAscii = 0
MsgBox "LETTERS ONLY"
End If

End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text8.Text <> "" Then
Text9.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub
Private Sub Text9_Change()
If Len(Text9.Text) > 10 Then
MsgBox "CONTACT NUMBER CONTAIN 10 DIGITS ONLY"

End If
End Sub
Private Sub checkin_Change()
MSRCASC-BCA V SEM Page 115
HOTEL MANAGEMENT SYSTEM

On Error GoTo errmsg

If checkin = "" Then


Adodc3.Recordset.Filter = ""

Adodc3.Refresh
Else
Adodc3.Recordset.Filter = "[cid] Like '" & checkin & "'"

Text1.Text = Adodc4.Recordset.Fields(0)
Text2.Text = Adodc4.Recordset.Fields(1)
Combo1.Text = Adodc4.Recordset.Fields(2)
DTPicker1.Value = Adodc4.Recordset.Fields(3)
Text3.Text = Adodc4.Recordset.Fields(4)
Text4.Text = Adodc4.Recordset.Fields(5)
Text5.Text = Adodc4.Recordset.Fields(6)
Text6.Text = Adodc4.Recordset.Fields(7)
Text7.Text = Adodc4.Recordset.Fields(8)
Combo2.Text = Adodc4.Recordset.Fields(9)
Text8.Text = Adodc4.Recordset.Fields(10)
Text9.Text = Adodc4.Recordset.Fields(11)
Text14.Text = Adodc1.Recordset.Fields(4)
Combo3.Text = Adodc1.Recordset.Fields(1)
Text10.Text = Adodc1.Recordset.Fields(2)

Text12.Text = Adodc1.Recordset.Fields(3)

Text13.Text = Adodc2.Recordset.Fields(7)
Exit Sub

DTPicker3.Value = Adodc3.Recordset.Fields(1)
DTPicker2.Value = Adodc3.Recordset.Fields(2)

End If
Exit Sub
errmsg:
MsgBox "DATA NOT FOUND"

End Sub
MSRCASC-BCA V SEM Page 116
HOTEL MANAGEMENT SYSTEM

Private Sub Text9_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text9.Text <> "" Then
Text9.SetFocus
ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub Timer1_Timer()


DTPicker2.Value = Format(Now, "dd-mm-yyyy")

End Sub

Restaurant:

Private Sub Command3_Click()


searchguest.Show
End Sub

Private Sub DTPicker1_Change()


DTPicker1.MinDate = Adodc3.Recordset.Fields(13)
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
DTPicker1.Value = Date
menu.Enabled = False
End Sub

Private Sub Form_Unload(Cancel As Integer)


menu.Enabled = True

End Sub

Private Sub Image1_Click()

MSRCASC-BCA V SEM Page 117


HOTEL MANAGEMENT SYSTEM

End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Text1.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"
End If

End Sub
Private Sub cmdback_Click()
Unload Me
menu.Show
End Sub
Private Sub Command1_Click()
If Label3.Caption = "NOT ACTIVE" Or Label3.Caption = "BOOKED"
Then
MsgBox "CUSTOMER IS NOT ACTIVE"
Exit Sub
End If
Dim a As Double
Dim b As Double
If Check1.Value = Checked Then
Text4.Text = Label9.Caption * Text3.Text
End If
If Check2.Value = Checked Then
Text6.Text = Label10.Caption * Text5.Text
End If
If Check3.Value = Checked Then
Text8.Text = Label11.Caption * Text7.Text
End If
If Check4.Value = Checked Then
Text10.Text = Label12.Caption * Text9.Text
End If
If Check5.Value = Checked Then
Text12.Text = Label13.Caption * Text11.Text
End If
If Check6.Value = Checked Then
Text14.Text = Label14.Caption * Text13.Text
End If
If Check7.Value = Checked Then
MSRCASC-BCA V SEM Page 118
HOTEL MANAGEMENT SYSTEM

Text16.Text = Label15.Caption * Text15.Text


End If
a = val(Text4.Text) + val(Text6.Text) + val(Text8.Text) + val(Text10.Text)
+ val(Text12.Text) + val(Text14.Text) + val(Text16.Text)
Label19.Caption = a
b = val(Label19.Caption) + val(Label21.Caption)
Label22.Caption = b
End Sub

Private Sub Command2_Click()


Adodc2.Recordset.Fields(4) = Label22.Caption
Adodc2.Recordset.Update
MsgBox "TRANSACTION COMPLETE"
End Sub

Private Sub payment_Change()


If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"
Label21.Caption = Adodc2.Recordset.Fields(4)

End If
End Sub
Private Sub room_Change()
If room = "" Then
Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[ID] Like '" & room & "'"
Text17.Text = Adodc4.Recordset.Fields(2)
End If
End Sub
Private Sub Text1_Change()
On Error GoTo errmsg
If Text1 = "" Then
Adodc3.Recordset.Filter = ""
Adodc3.Refresh
Else
MSRCASC-BCA V SEM Page 119
HOTEL MANAGEMENT SYSTEM

Adodc3.Recordset.Filter = "[Customer_ID] Like '" & Text1 & "'"


Text2.Text = Adodc3.Recordset.Fields(1)
Text17.Text = Adodc4.Recordset.Fields(2)
Label3.Caption = Adodc3.Recordset.Fields(12)
Label19.Caption = ""
DTPicker1.Value = Date
DTPicker1.MinDate = Date
End If
payment.Caption = Text1.Text
room.Caption = Text1.Text
Exit Sub
errmsg:
If Err.Number = "3021" Then
Text1.Text = ""
Text2.Text = ""
Text17.Text = ""
Label19.Caption = ""
Label21.Caption = ""
Call MsgBox("Customer Not exist")
Else
MsgBox Err.Description
End If
End Sub

Laundry :
Option Explicit
Dim operand1 As Double, operand As Double
Dim op1 As Double, op2 As Double
Dim operator As String
Dim cleardisplay As Boolean
Private Sub cmdadd_Click()
If Label2.Caption = "NOT ACTIVE" Then
MsgBox "CUSTOMER IS NOT ACTIVE"
Exit Sub
End If

op1 = val(Text3.Text)
operator = "*"
Dim result1 As Double

MSRCASC-BCA V SEM Page 120


HOTEL MANAGEMENT SYSTEM

op2 = val(Label12.Caption)
result1 = mul(ByVal op1, ByVal op2)
Label10.Caption = result1
op1 = val(Text4.Text)
operator = "*"
Dim result2 As Double
op2 = val(Label15.Caption)
result2 = mul(ByVal op1, ByVal op2)
Label11.Caption = result2
op1 = val(Label10.Caption)
operator = "+"
Dim result3 As Double
op2 = val(Label11.Caption)
result3 = add(ByVal op1, ByVal op2)
Label17.Caption = result3
op1 = val(Label17.Caption)
operator = "+"
Dim result4 As Double
op2 = val(Label16.Caption)
result4 = add(ByVal op1, ByVal op2)
Text5.Text = result4
Dim result5 As Double
op1 = val(Label24.Caption)
operator = "+"
op2 = val(Text3.Text)
result5 = add(ByVal op1, ByVal op2)
Label24.Caption = result5
Dim result6 As Double
op1 = val(Label25.Caption)
operator = "+"
op2 = val(Text4.Text)
result6 = add(ByVal op1, ByVal op2)
Label25.Caption = result6
End Sub
Private Sub cmdback_Click()
Unload Me
menu.Show
End Sub
Private Function mul(ByVal operand1 As Double, ByVal operand2 As
Double) As Double
mul = operand1 * operand2
MSRCASC-BCA V SEM Page 121
HOTEL MANAGEMENT SYSTEM

End Function
Private Function add(ByVal operand1 As Double, ByVal operand2 As
Double) As Double
add = operand1 + operand2
End Function
Private Sub cmdsave_Click()
On Error GoTo errmsg
If Text1.Text = "" Or Text2.Text = "" Or Text6.Text = "" Or Combo1.Text =
"--SELECT--" Then
MsgBox "TRANSACTION NOT ALLOWED,FILL ALL DETAILS"
Exit Sub
End If

Adodc3.Recordset.Fields(1) = Label24.Caption
Adodc3.Recordset.Fields(5) = Combo1.Text
Adodc3.Recordset.Fields(2) = Label25.Caption

Adodc3.Recordset.Fields(4) = DTPicker2.Value
Adodc2.Recordset.Fields(5) = Text5.Text
Adodc1.Recordset.Update
Adodc2.Recordset.Update
Adodc3.Recordset.Update
MsgBox "TRANSACTION COMPLETE"
Exit Sub
errmsg:
MsgBox Err.Description

End Sub

Private Sub Command1_Click()


searchguest.Show
End Sub

Private Sub DTPicker2_Change()


DTPicker2.MinDate = Adodc4.Recordset.Fields(13)
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
DTPicker2.Value = Date
menu.Enabled = False
MSRCASC-BCA V SEM Page 122
HOTEL MANAGEMENT SYSTEM

End Sub

Private Sub Form_Unload(Cancel As Integer)


menu.Enabled = True

End Sub

Private Sub Label26_Change()


If Label26 = "" Then
Adodc3.Recordset.Filter = ""
Adodc3.Refresh
Else
Adodc3.Recordset.Filter = "[lid] Like '" & Label26 & "'"
End If
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text1.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"
End If
End Sub

Private Sub Text1_Change()


On Error GoTo errmsg
If Text1 = "" Then
Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_ID] Like '" & Text1 & "'"

Text6.Text = Adodc4.Recordset.Fields(1)
Label2.Caption = Adodc4.Recordset.Fields(12)
DTPicker2.Value = Adodc4.Recordset.Fields(13)
End If
payment.Caption = Text1.Text
room.Caption = Text1.Text
Label26.Caption = Text1.Text
MSRCASC-BCA V SEM Page 123
HOTEL MANAGEMENT SYSTEM

Exit Sub
errmsg:
If Err.Number = "3021" Then
Text1.Text = ""
Text2.Text = ""
Text6.Text = ""
Label16.Caption = ""
Label17.Caption = ""
Combo1.Text = "--SELECT--"
Call MsgBox("Customer Not exist")
Else
MsgBox Err.Description

End If

End Sub
Private Sub payment_Change()
If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"

Label16.Caption = Adodc2.Recordset.Fields(5)

End If
End Sub
Private Sub room_Change()
If room = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else
Adodc5.Recordset.Filter = "[ID] Like '" & room & "'"
Text2.Text = Adodc5.Recordset.Fields(2)
End If
End Sub

MSRCASC-BCA V SEM Page 124


HOTEL MANAGEMENT SYSTEM

Payment :
Private Sub checkin_Change()
If checkin = "" Then
Adodc6.Recordset.Filter = ""
Adodc6.Refresh
Else
Adodc6.Recordset.Filter = "[cid] Like '" & checkin & "'"
Label11.Caption = Adodc6.Recordset.Fields(2)

End If
End Sub

Private Sub cmdback_Click()


Unload Me
menu.Show
End Sub

Private Sub CMDCALCULATE_Click()

If Label6.Caption = "NOT ACTIVE" Then


MsgBox "CUSTOMER IS NOT ACTIVE"
Exit Sub
End If
If Text5.Text = "" Or Text6.Text = "" Then
MsgBox " PLEASE ENTER EXTRA CHARGE ,DISCOUNT"
Exit Sub
End If
Dim i As Double
If Len(Text14) = 11 Then
Adodc3.Refresh
i = Adodc3.Recordset("singleroom") * val(Text9.Text)
Text13.Text = i
End If
Dim a As Double
If Len(Text14) = 10 Then
Adodc3.Refresh
a = Adodc3.Recordset("suitroom") * val(Text9.Text)
Text13.Text = a
End If
MSRCASC-BCA V SEM Page 125
HOTEL MANAGEMENT SYSTEM

Dim b As Double
If Len(Text14) = 12 Then
Adodc3.Refresh
b = Adodc3.Recordset("deluxroom") * val(Text9.Text)
Text13.Text = b
End If
Dim c As Double
If Len(Text14) = 13 Then
Adodc3.Refresh
c = Adodc3.Recordset("standardroom") * val(Text9.Text)
Text13.Text = c
End If
Dim tot As Double
tot = val(Text5) + val(Text6) + val(Text10) + val(Text11) + val(Text13)
Text7.Text = val(tot) + (4 / 100) * val(tot)
Text15.Text = (4 / 100) * val(tot)
Dim bal As Double
bal = val(tot) - val(Text4) + val(Text15.Text)
Text8.Text = val(bal)

End Sub

Private Sub Command1_Click()


Set rs = New ADODB.Recordset

rs.Open "select * from Paymentlog where Customer_ID ='" & Text1 & "'",
cn, 3, 2

If Not rs.EOF Then


Set DataReport1.DataSource = rs

DataReport1.Show
End If
End Sub

Private Sub Command2_Click()

If Text5.Text = "" Or Text6.Text = "" Or Combo1.Text = "--SELECT--"


Then
MsgBox " PLEASE ENTER EXTRA CHARGE ,DISCOUNT STATUS "

MSRCASC-BCA V SEM Page 126


HOTEL MANAGEMENT SYSTEM

Exit Sub
End If

Adodc2.Recordset.Fields(1) = Text6.Text
Adodc2.Recordset.Fields(2) = Text5.Text
Adodc2.Recordset.Fields(3) = Text8.Text
Adodc2.Recordset.Fields(6) = Text7.Text
Adodc2.Recordset.Fields(8) = Combo1.Text
Adodc2.Recordset.Fields(9) = Text13.Text
Adodc1.Recordset.Fields(3) = Text9.Text
Adodc2.Recordset.Fields(10) = Text15.Text

Adodc5.Recordset.AddNew

Adodc5.Recordset.Fields(1) = Text1.Text
Adodc5.Recordset.Fields(2) = Text2.Text
Adodc5.Recordset.Fields(3) = Text13.Text
Adodc5.Recordset.Fields(5) = Text6.Text
Adodc5.Recordset.Fields(6) = Text5.Text
Adodc5.Recordset.Fields(7) = Text10.Text
Adodc5.Recordset.Fields(8) = Text11.Text
Adodc5.Recordset.Fields(9) = Text7.Text
Adodc5.Recordset.Fields(10) = Combo1.Text
Adodc5.Recordset.Fields(11) = Text9.Text
Adodc5.Recordset.Fields(12) = Combo1.Text
Adodc5.Recordset.Fields(13) = Text3.Text
Adodc5.Recordset.Fields(14) = Label14.Caption
Adodc5.Recordset.Fields(15) = Text8.Text
Adodc5.Recordset.Fields(4) = Text4.Text
Adodc5.Recordset.Fields(16) = Text15.Text
Adodc5.Recordset.Update
Adodc2.Recordset.Update
Adodc1.Recordset.Update

MsgBox " PAYMENT DONE"

End Sub

Private Sub Command3_Click()


searchguest.Show
End Sub
MSRCASC-BCA V SEM Page 127
HOTEL MANAGEMENT SYSTEM

Private Sub Form_Load()


Me.WindowState = vbMaximized

menu.Enabled = False
Label14.Caption = Date
Timer1.Enabled = True
connect
Set rs = New ADODB.Recordset
rs.Source = "Payment"
rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open
End Sub

Private Sub Form_Unload(Cancel As Integer)


menu.Enabled = True

End Sub

Private Sub Label11_Change()


Dim Date1 As Date

Dim Date2 As Date


Date1 = Label11.Caption
Date2 = Label14.Caption

Text9.Text = Adodc1.Recordset.Fields(3)

End Sub

Private Sub payment_Change()


If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"
Text4.Text = Adodc2.Recordset.Fields(7)
Text13.Text = Adodc2.Recordset.Fields(9)
Text7.Text = Adodc2.Recordset.Fields(6)
MSRCASC-BCA V SEM Page 128
HOTEL MANAGEMENT SYSTEM

Combo1.Text = Adodc2.Recordset.Fields(8)
Text10.Text = Adodc2.Recordset.Fields(4)
Text11.Text = Adodc2.Recordset.Fields(5)

End If
End Sub

Private Sub room_Change()


If room = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else
Adodc1.Recordset.Filter = "[ID] Like '" & room & "'"
Text14.Text = Adodc1.Recordset.Fields(1)
Text3.Text = Adodc1.Recordset.Fields(2)
Text9.Text = Adodc1.Recordset.Fields(3)
End If
End Sub

Private Sub Text12_Change()

On Error GoTo errmsg

If Text12 = "" Then


Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_ID] Like '" & Text12 & "'"
Text1.Text = Adodc4.Recordset.Fields(0)
Text2.Text = Adodc4.Recordset.Fields(1)

Label6.Caption = Adodc4.Recordset.Fields(12)
End If
payment.Caption = Text1.Text
room.Caption = Text1.Text
checkin.Caption = Text1.Text

Exit Sub
errmsg:
If Err.Number = "3021" Then
Call MsgBox("Customer Not exist")
MSRCASC-BCA V SEM Page 129
HOTEL MANAGEMENT SYSTEM

Text12.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""

Text10.Text = ""
Text11.Text = ""
Text13.Text = ""
Text14.Text = ""
Combo1.Text = "--SELECT--"
Else
MsgBox Err.Description

End If

End Sub

Private Sub Text12_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text12.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"

End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text5.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub
MSRCASC-BCA V SEM Page 130
HOTEL MANAGEMENT SYSTEM

Private Sub Text6_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text6.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

Private Sub Text9_Change()


Dim a As Integer

a = val(Text9.Text)
If a = 0 Then
Text9.Text = 1
End If

End Sub

Private Sub Timer1_Timer()


Label14.Caption = Format(Now, "dd-mm-yyyy")
End Sub

Check out :
Private Sub cmdback_Click()
Unload Me
menu.Show
End Sub

Private Sub cmdcheckout_Click()

On Error GoTo errmsg


If Text15.Text = "" Then
MsgBox " Select Customer First"
Exit Sub
End If

If Combo1.Text = "--SELECT--" Then


MSRCASC-BCA V SEM Page 131
HOTEL MANAGEMENT SYSTEM

MsgBox "PLEASE FILL THE REQUIRED FIELDS"


Exit Sub
End If

If Text11.Text = "DUE" Then


MsgBox "must clear all the dues"
Exit Sub
End If

If Label15.Caption = "NOT ACTIVE" Then


MsgBox "CUSTOMER IS NOT ACTIVE"
Exit Sub
End If
Adodc4.Recordset.Fields(12) = "NOT ACTIVE"
Adodc3.Recordset.Fields(3) = DTPicker3.Value
Adodc3.Recordset.Fields(4) = DTPicker2(0).Value
Adodc1.Recordset.Fields(5) = Combo1.Text
Adodc3.Recordset.Update
Adodc1.Recordset.Update
Adodc4.Recordset.Update

MsgBox "CHECK-OUT RECORD UPDATED"


Exit Sub
errmsg:

End Sub

Private Sub Combo3_click()


Dim val As String

val = Combo3.Text
Select Case val

Case "SINGLE ROOM"


Label11.Caption = "1"
If Label11.Caption = "1" Then
singleroom.Show
End If

MSRCASC-BCA V SEM Page 132


HOTEL MANAGEMENT SYSTEM

Case "STANDARD-ROOM"
Label11.Caption = "2"
If Label11.Caption = "2" Then
standardroom.Show
End If

Case "DELUXE- ROOM"


Label11.Caption = "3"
If Label11.Caption = "3" Then
deluxeroom.Show
End If
Case "SUITE-ROOM"
Label11.Caption = "4"
If Label11.Caption = "4" Then
suiteroom.Show
End If
End Select
End Sub

Private Sub Command1_Click()


searchguest.Show
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
DTPicker2(0).Value = Date
DTPicker3.Value = Time
End Sub

Private Sub payment_Change()


On Error GoTo errmsg
If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"
Text13.Text = Adodc2.Recordset.Fields(7)
Text11.Text = Adodc2.Recordset.Fields(8)
End If
Exit Sub
errmsg:
MSRCASC-BCA V SEM Page 133
HOTEL MANAGEMENT SYSTEM

End Sub
Private Sub room_Change()
On Error GoTo errmsg
If room = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else
Adodc1.Recordset.Filter = "[ID] Like '" & room & "'"
Combo3.Text = Adodc1.Recordset.Fields(1)
Text10.Text = Adodc1.Recordset.Fields(2)

Text12.Text = Adodc1.Recordset.Fields(3)
Text14.Text = Adodc1.Recordset.Fields(4)

End If
Exit Sub
errmsg:
End Sub
Private Sub Text15_Change()
On Error GoTo errmsg
If Text15 = "" Then
Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_ID] Like '" & Text15 & "'"
Label15.Caption = Adodc4.Recordset.Fields(12)
Text1.Text = Adodc4.Recordset.Fields(0)
Text2.Text = Adodc4.Recordset.Fields(1)
Text16.Text = Adodc4.Recordset.Fields(2)
Text17.Text = Adodc4.Recordset.Fields(3)
Text3.Text = Adodc4.Recordset.Fields(4)
Text4.Text = Adodc4.Recordset.Fields(5)
Text5.Text = Adodc4.Recordset.Fields(6)
Text6.Text = Adodc4.Recordset.Fields(7)
Text7.Text = Adodc4.Recordset.Fields(8)
Text18.Text = Adodc4.Recordset.Fields(9)
Text8.Text = Adodc4.Recordset.Fields(10)
Text9.Text = Adodc4.Recordset.Fields(11)
DTPicker2(0).Value = Date
DTPicker2(0).MinDate = Date

MSRCASC-BCA V SEM Page 134


HOTEL MANAGEMENT SYSTEM

End If
payment.Caption = Text15.Text
room.Caption = Text15.Text
checkin.Caption = Text15.Text
Exit Sub
errmsg:
If Err.Number = "3021" Then
Text15.Text = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text16.Text = ""
Text18.Text = ""
Text11.Text = ""
Combo1.Text = "--select--"

Combo3.Text = "--SELECT--"
Text10.Text = ""
Text14.Text = ""
Text12.Text = ""
Text13.Text = ""
Call MsgBox("Customer Not exist")

Else
MsgBox Err.Description

End If

End Sub

Private Sub checkin_Change()


On Error GoTo errmsg

If checkin = "" Then


MSRCASC-BCA V SEM Page 135
HOTEL MANAGEMENT SYSTEM

Adodc3.Recordset.Filter = ""

Adodc3.Refresh
Else
Adodc3.Recordset.Filter = "[cid] Like '" & checkin & "'"
DTPicker3.Value = Adodc3.Recordset.Fields(3)

End If
Exit Sub
errmsg:

End Sub

Private Sub Text15_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text15.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "CUSTOMER ID ONLY"

End If
End Sub

Private Sub Timer1_Timer()


DTPicker2(0).Value = Format(Now, "dd-mm-yyyy")
End Sub

Search Guest :

Private Sub Command1_Click()


Unload Me
menu.Show

End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
menu.Enabled = False
MSRCASC-BCA V SEM Page 136
HOTEL MANAGEMENT SYSTEM

End Sub

Private Sub Form_Unload(Cancel As Integer)


menu.Enabled = True

End Sub

Private Sub checkout_Change()


If checkout = "" Then
Adodc3.Recordset.Filter = ""
Adodc3.Refresh
Else
Adodc3.Recordset.Filter = "[cid] Like '" & checkout & "'"
End If
End Sub

Private Sub payment_Change()


If payment = "" Then
Adodc2.Recordset.Filter = ""
Adodc2.Refresh
Else
Adodc2.Recordset.Filter = "[PID] Like '" & payment & "'"
End If
End Sub

Private Sub room_Change()


If room = "" Then
Adodc1.Recordset.Filter = ""
Adodc1.Refresh
Else

Adodc1.Recordset.Filter = "[ID] Like '" & room & "'"


End If
End Sub

MSRCASC-BCA V SEM Page 137


HOTEL MANAGEMENT SYSTEM

Private Sub Text1_Change()


Label12.Caption = Text1.Text
checkout.Caption = Text1.Text
room.Caption = Text1.Text
payment.Caption = Text1.Text
End Sub

Private Sub Text22_Change()


On Error GoTo errmsg
If Text22 = "" Then
Adodc4.Recordset.Filter = ""
Adodc4.Refresh
Else
Adodc4.Recordset.Filter = "[Customer_ID] Like '*" & Text22 &
"*'"

Text1.Text = Adodc4.Recordset.Fields(0)
Text2.Text = Adodc4.Recordset.Fields(1)
Text3.Text = Adodc4.Recordset.Fields(2)
Text4.Text = Adodc4.Recordset.Fields(3)
Text5.Text = Adodc4.Recordset.Fields(4)
Text6.Text = Adodc4.Recordset.Fields(5)
Text7.Text = Adodc4.Recordset.Fields(6)
Text8.Text = Adodc4.Recordset.Fields(7)
Text9.Text = Adodc4.Recordset.Fields(8)
Text10.Text = Adodc4.Recordset.Fields(9)
Text11.Text = Adodc4.Recordset.Fields(10)
Text12.Text = Adodc4.Recordset.Fields(11)

Label10.Caption = Adodc4.Recordset.Fields(12)

Text13.Text = Adodc1.Recordset.Fields(1)

MSRCASC-BCA V SEM Page 138


HOTEL MANAGEMENT SYSTEM

Text14.Text = Adodc1.Recordset.Fields(2)

Text23.Text = Adodc1.Recordset.Fields(4)

Text17.Text = Adodc2.Recordset.Fields(7)

Text18.Text = Adodc3.Recordset.Fields(1)
Text19.Text = Adodc3.Recordset.Fields(2)

Text20.Text = Adodc3.Recordset.Fields(3)
Text21.Text = Adodc3.Recordset.Fields(4)

End If
Exit Sub
errmsg:
If Err.Number = "3021" Then
Text22.Text = ""
Call MsgBox("Customer Not exist")

Else
MsgBox Err.Description

End If

End Sub

Private Sub Text22_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 And Text20.Text <> "" Then

ElseIf (KeyAscii < 48 And KeyAscii <> 8) Or KeyAscii > 57 Then


KeyAscii = 0
MsgBox "DIGITS ONLY"
End If
End Sub

MSRCASC-BCA V SEM Page 139


HOTEL MANAGEMENT SYSTEM

Rate List :
Private Sub Command1_Click()
roomrates.Show
End Sub

Private Sub Command2_Click()


restaurantrates.Show
End Sub

Private Sub Command3_Click()


LaundryRate.Show
End Sub

Private Sub Command4_Click()


Unload Me

End Sub

Private Sub Form_Load()


menu.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


menu.Enabled = True

End Sub

Private Sub Label1_Click()


roomrates.Show
End Sub

Private Sub Label2_Click()


restaurantrates.Show
End Sub

MSRCASC-BCA V SEM Page 140


HOTEL MANAGEMENT SYSTEM

Private Sub Label3_Click()


LaundryRate.Show
End Sub

Private Sub Label4_Click()


Unload Me
End Sub

Status :
Public a As String
Private Sub cmdback_Click()
Unload Me
menu.Show
End Sub

Private Sub Form_Load()

menu.Enabled = False

a = Label16.Caption
b = Label23.Caption
Label2.Caption = Adodc1.Recordset.RecordCount
Label3.Caption = Adodc2.Recordset.RecordCount
Label4.Caption = Adodc3.Recordset.RecordCount
Label5.Caption = Adodc4.Recordset.RecordCount
Label1.Caption = val(Label2.Caption) + val(Label3.Caption) +
val(Label4.Caption) + val(Label5.Caption)

Adodc1.RecordSource = " select * from singleroom where status ='" + a + "'


"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Label7.Caption = "0"
Else
Label7.Caption = Adodc1.Recordset.RecordCount
End If

Adodc1.RecordSource = " select * from singleroom where status ='" + b + "'


"
MSRCASC-BCA V SEM Page 141
HOTEL MANAGEMENT SYSTEM

Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Label19.Caption = "0"
Else
Label19.Caption = Adodc1.Recordset.RecordCount
End If

Adodc2.RecordSource = " select * from standardroom where status ='" + a +


"' "
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
Label8.Caption = "0"
Else
Label8.Caption = Adodc2.Recordset.RecordCount
End If

Adodc2.RecordSource = " select * from standardroom where status ='" + b +


"' "
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
Label20.Caption = "0"
Else
Label20.Caption = Adodc2.Recordset.RecordCount
End If

Adodc3.RecordSource = " select * from suitroom where status ='" + a + "' "
Adodc3.Refresh
If Adodc3.Recordset.RecordCount = 0 Then
Label9.Caption = "0"
Else
Label9.Caption = Adodc3.Recordset.RecordCount
End If

Adodc3.RecordSource = " select * from suitroom where status ='" + b + "' "
Adodc3.Refresh
If Adodc3.Recordset.RecordCount = 0 Then
Label21.Caption = "0"
Else
Label21.Caption = Adodc3.Recordset.RecordCount
End If

MSRCASC-BCA V SEM Page 142


HOTEL MANAGEMENT SYSTEM

Adodc4.RecordSource = " select * from deluxroom where status ='" + a + "'


"
Adodc4.Refresh
If Adodc4.Recordset.RecordCount = 0 Then
Label10.Caption = "0"
Else
Label10.Caption = Adodc4.Recordset.RecordCount

End If

Adodc4.RecordSource = " select * from deluxroom where status ='" + b + "'


"
Adodc4.Refresh
If Adodc4.Recordset.RecordCount = 0 Then
Label22.Caption = "0"
Else
Label22.Caption = Adodc4.Recordset.RecordCount

End If

Label6.Caption = val(Label7.Caption) + val(Label8.Caption) +


val(Label9.Caption) + val(Label10.Caption)

Label18.Caption = val(Label19.Caption) + val(Label20.Caption) +


val(Label21.Caption) + val(Label22.Caption)

Label12.Caption = val(Label2.Caption) - (val(Label7.Caption) +


val(Label19.Caption))

Label13.Caption = val(Label3.Caption) - (val(Label8.Caption) +


val(Label20.Caption))
Label14.Caption = val(Label4.Caption) - (val(Label9.Caption) +
val(Label21.Caption))
Label15.Caption = val(Label5.Caption) - (val(Label10.Caption) +
val(Label21.Caption))
Label11.Caption = val(Label12.Caption) + val(Label13.Caption) +
val(Label14.Caption) + val(Label15.Caption)

End Sub

MSRCASC-BCA V SEM Page 143


HOTEL MANAGEMENT SYSTEM

Private Sub Form_Unload(Cancel As Integer)


menu.Enabled = True
End Sub

MSRCASC-BCA V SEM Page 144


HOTEL MANAGEMENT SYSTEM

Specification Analysis
The very first step in a system, for the purpose of selection is understanding the
requirements within the framework of the organization’s objectives and the environment in which
that system is being installed. Consideration is given to the user’s resources as well as to finances.
It is a document that serves as a foundation for hardware, software and database engineering. It
describes the functions of a system and the constraints that will govern its development. The
specifications bound each allocated system analyst with an indication of the role of software
within the context of the computer based system as a whole and the various subsystems described
in the data flow diagrams.

The system specification also describes the information that is to input and to output from the
system.

Fact-Finding
Fact-finding means, learning as much as possible about the present system. Fact-finding is the
formal process of using research, interviews, questionnaires, sampling and other techniques to
collect information about systems, requirements and preferences. It is also called information
gathering or data collections. Tools, such as data and process models, document facts, and
conclusions are drawn from facts. If you can’t collect the facts, you can’t use the tools. Fact-
finding skills must be learned and practiced.

MSRCASC-BCA V SEM Page 145


HOTEL MANAGEMENT SYSTEM

How to do Fact-Finding?
For fact-finding, the system analyst does the following:
1. Sampling of written (existing) documents
2. On-site observations
3. Interview
4. Questionnaires
5. Research and site visits.
6. Observes the current system
7. Gather forms and documents currently in use
8. Determines the flow of data through the system, and
9. Clearly defines the system requirements.

MSRCASC-BCA V SEM Page 146


HOTEL MANAGEMENT SYSTEM

Conclusion

Advantages
1. To manipulate the Hotel transactions with instant confirmation .
2. To save time and accuracy in work.
3. To increase efficiency of employee.
4. For fast access of data.
5. For secure and smooth running of the program.
6. For error free, effective and easy for database related works.

Disadvantages
1. Rooms won’t be booked if there is power failure.
2. Rooms cannot be booked online.
3. Customer id is not the same, if same customer returns to hotel.

MSRCASC-BCA V SEM Page 147


HOTEL MANAGEMENT SYSTEM

BIBLIOGRAPHY

Books

 A Complete Guide to Programming in Visual Basic .Net


 A Complete Visual Basic 6 Training Course: How to Programme: Package
 Advanced Programming Using Visual Basic: Version 6.0
 Access 2003 Power Programming with VBA
 Advanced MS Visual Basic

Site Address

 www.associatedcontent.com
 www.members.tripod.com
 www.vbcodesource.com

MSRCASC-BCA V SEM Page 148


HOTEL MANAGEMENT SYSTEM

MSRCASC-BCA V SEM Page 149

You might also like