Downloaded from Studynama.com.
Click to download unlimited free college projects »
1|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
INTRODUCTION TO ASSIGNED
PROJECT
Hotel Management System is developed for
making the work of the hotel systemized. It can
do all functions like can reserve rooms, can show
status of rooms available, and can reserve rooms
in any class like single room or AC. It can also
print those details which are already in this
program through a printer. It also helps in
maintaining accounts of the Hotel. Using it, a
person doesn’t need to go through the registers
and search for the rooms available. The system
will be developed under Windows XP as an
operating system and Visual Basic as front end
and Microsoft Access as back end.
This system can also generate a report. At last,
we can say the system covers all the aspects of
making the hotel management system easier.
2|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
CONTENTS
Preface
Objectives
Visual Basic- an introduction
Designing of Database
Relationship in Tables
System Requirement Analysis
Analysis Report
System Design
Program Structure
Screen shot of Software
Testing
Validation Of Data
Software Development
Software Implementation
Tools/Environment Used
Coding
3|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
METHODOLOGY
The Methodology used in “Classic life cycle”
System
Engineering
Analysis
Design
Coding
Testing
Implement
Maintenance
METHODOLOGY
4|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Development of a program is an important process that
involves steps similar to any problem solving task .there are
five main steps in the programming.
Process:-
Defining the problems
Planning and solution
Coding the problem
Testing the problem
Documenting the problem.
5|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Defining the problem:-
The first step is to define the problem. In this step the
problem is clearly understood and started in detail. The
statement consists of :-
A layout how to solve the problem
What are the inputs to the problem?
What are the output of the problem that to do
Obtained from the software developed to solve the
problem
List of constraints, if applicable, in the program.
Some formula, if to be used in the program.
6|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
VISUAL BASIC ENVIRONMENT
VISUAL BASIC:-
Welcome to Microsoft visual basic, the fastest easiest
way to create application for Microsoft windows. Whether
you are an experienced professional or brand new to
windows programming, visual basic provide you with a
complete set of tools to simplify rapid application
development.
So what is visual basic the “visual” part refers
to the method used to create the graphic user interface
(GUI). Rather then writing numerous line of code to describe
the appearance and location of the interface element, you
simply add rebuilt objects into place on your screen. If
you’ve ever used a drawing program such as paint, you
already have most of skills necessary to create an effective
user interface.
7|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
The basic part refers to the basic programmers’
all-purpose symbolic instruction code language, a language
used by more programmers then any other language in
history of computing. Visual basic has involved from the
original basic language and now contains several hundred
statement, function, and keywords, many of which relate
directly to the windows GUI. Beginners can create useful
applications by learning just a few of the keywords, yet the
power of the language allows professional to accomplish
anything that can be accomplished using any other windows
programming language.
The programming language is not unique to visual basic.
The visual basic programming system, application edition
included in Microsoft Excel, Microsoft Access and many
other windows applications uses the same language. The
visual basic scripting Edition (VB script) is widely used
scripting language and a subset of the visual basic language.
The investment you make in learning visual basic will carry
over to these other areas.
Whether your goal is to create a small
utility for yourself or your work group, a large enterprise –
8|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
wide system or even distributed application spanning the
glob via the internet, visual basic has the tools as you need.
Data access features allow to create database, front and
applications, and scalable server side component for
most popular database formats, including Microsoft
SQL server and other enterprise level database.
Active X technologies allow you to use the
functionality provided by other applications, such as
Microsoft word, word processor, Microsoft excel
spreadsheet and other windows applications. You can
even automate your applications and object created
using the professional or enterprise additions of visual
basic.
Internet capabilities make it easy to provide access to
document and applications accurse the internet or
intranet from within your application, or to create
internet server applications.
9|Page
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Your finished applications are a true. Exe file that use a
visual basic virtual machine that you can freely
distribute.
DOCUMENTING THE PROGRAM
After the program has been written for the solution of a
problem that had been implemented successfully on the
computer it appears as if the job of the programmer has
finished. The input of the program, output of the program,
there design and layouts, data structure, data files and special
procedures, all such information is called and presented in a
precise and concise form.
10 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Documentation must contain the following information:
In detail, what the purpose of program?
Who has developed the program for whom?
What does the program do?
What are the files used with that software?
Detailed description of that data files
Security measures inbuilt in that software.
11 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
SOFTWARE DESIGN
DESIGNING
Design phase of software development deals with
transferring the costumer requirements as described in the
SRS document into a form implement able using a
programming language. In order to easily implement able in
conventional programming language, the following items
must be design during the design phase.
Different module required to implement design phase
solution.
Control relationship among the identified modules.
Interface among different modules.
Data structures of the individual modules.
Algorithm required implementing the individual
modules.
12 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Thus the goal of the design phase to take the SRS
document as the input and the input to produce the above
mentioned items at the completion stage of the design
phase.
However, we can broadly classify
various design activities into two important parts:
Preliminary design
Detailed design
But the meaning and scope of these two stages may vary
considerably from one methodology to another. We will
assume in the text during high level design, deferent module
and control relationship among them are identified and the
interface among these modules is defined. The outcome of
high level design is called the program structure or software
architecture. Many different nations are used to represent a
high level design.
13 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Usually a tree –like diagram called the
structure chart is used to represent the control hierarchy in a
high -level design.
During detailed design the data structure and the algorithm
used by the different modules the design is usually known as
the module specification document.
What is good software design?
A good design should capture all the functionalities of
the system correctly.
It should be easily under stable.
It should be efficient.
It should be amenable to change.
It should be easily maintainable.
14 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
HARDWARE SPECIFICATION
Hardware is necessary background for making run time base
for any software. ------------------------------- is light complex
software and that way it requires very few hardware
specification. The system requirement includes:-
Minimum memory space - 32 MB
Minimum disk space - 1.2 GB
Minimum speed processor - 486MHZ
A minimum 32 MB RAM is required.
Pentium series processors vary well for
execution of program.
A good resolution colored monitor unit high
refreshing rate is also helpful for achieving
good graphics.
15 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
SOFTWARE SPECIFICATION
Software is easily executed by compiling the source code.
Graphics by requires a good pixel environment so that image
can be drown easily and effectively.
Platform - window 98/2000/xp
Compiler – VB studies 6.0 (front end)
MS Access (Backend)
In this library management system project the platform
used in either window 98 or windows XP. The compiler of
the project is done in visual basic 6.0. Which is used as the
front end and MS Access is used as the backend of the
project.
16 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
SOFTWARE DEVELOPMENT TOOLS
1. INTERFACE DESIGN TOOLS.
BUTTONS:
The command button control is used to begin,
interrupt, or end a process. When clicked, it
invokes a command that has been written into its
Click event procedure.
Most Visual Basic applications have command
buttons that allow the user to simply click them to
perform actions. When the user chooses the
button, it not only carries out the appropriate
action, it also looks as if it’s being pushed in and
released and is therefore sometimes referred to as
a push button.
For more information see “Clicking Buttons to
perform actions” in “forms, Controls, and
17 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Menus” for a simple demonstration of the
command button control. See “Clicking Buttons
to perform actions” in “forms, Controls, and
Menus” for a simple demonstration of the
command control.
You will likely use one or more command
buttons in your application. To add command
buttons to a form, draw them on as you would
any other control. Command button can be sized.
Setting the caption:
To change the text displayed on the command,
use the caption property. At design time, you can
set this property by selecting it from the control
properties window. When you set the caption
property at design time, the button text will be
updated dynamically.
You can set the caption property up to 255 total
characters. If your caption exceeds the width of
the command button it will wrap to the next line.
However, it will be clipped if the control cannot
accommodate its overall height.
18 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
You can change the front display on the
command button by setting its front property.
Creating the keyboard shortcuts:
You can use the caption property to create access
key shortcuts for your command buttons by
adding an ampersand (&) before the alphabet you
want to use as the access key. For example, to
create an access key for the caption “Print” you
add an ampersand before the alphabet “P”:
“&Print”. At run time, the alphabet “P” will be
underlined and the user can select the command
by simultaneously pressing ALT+P.
NOTE: to include an ampersand in a caption
without creating an access key include two
ampersands (&&). A single ampersand is
displayed in the caption and no characters are
underlined.
19 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Specifying the default and cancel properties:
On each form, you can select a command to be
the default command button ----- that is,
whenever the user presses the ENTER key, the
command button is clicked regardless of which
other controls on the form has the focus. To
specify a command button as default, set the
default property to true.
You can also specify a default cancel command.
When the cancel property of a command button is
set to true, it will be clicked whenever the user
presses the ESC key, regardless of which other
control on the form has the focus.
A command button can be selected at run time by
using the mouse or keyboard in the following
ways:
Use a mouse to click the button.
20 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Move the focus to the button by pressing the
TAB key, and then choose the button by
pressing the SPACEBAR or ENTER.
Press an access key (ALT+ the underlined
letter) for a command button.
If the command button is the default cancel
button for the form, pressing ENTER
chooses the button, even if you change the
focus to a different control.
If the command button is the default cancel
button for the form, then pressing ESC
chooses the button, even if you change the
focus to a different control.
The value property:
Whenever the command button is selected, its
value property is set to true and the click event is
triggered. False (default) indicates a button isn’t
chosen. You can use the value property in code to
21 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
trigger the command button’s click event. For
example:
cmdClose.Value=True
The Click Event:
When clicked, the command button’s Click event
is
Triggered and the code you’ve written in the
Click event procedure is invoked.
Clicking a command button control also
generates the
Mouse Down and Mouse Up events. If you intend
to attach event procedures for these related
events, be sure that their actions don’t conflict.
The order in which these three
Event occurs varies from control to control. In the
command button control, these events occur in
this order: Mouse Down, Click, and Mouse Up.
22 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Note: if the user attempts to double-click the
command
Button control, each click will be processed
separately;
That is, the command button control does not
support the
Double-click event.
For More Information See reference of Visual
Basic,
And Blacks Books “Responding to the Mouse
and Keyboard Events,” for more information on
the Mouse Down and Mouse Up events. See
“Responding to Mouse and Keyboard Events” for
more information on the Mouse Down and
Mouse Up events.
The command button control, like the check box
and option button control, may be visually
enhanced by alerting the setting of the style
property and then using the picture, Down Picture
and Disabled Picture properties. For example,
you may want to add an icon or bitmap to a
command button or display a different image
when the button is clicked or disabled.
23 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
__You will likely use one or more command
button in your application. To add command
buttons to a form, draw them on as you would
any other control. Command Buttons can be sized
with the mouse or by setting their Height Width
properties.
Setting the Caption
To change the text displayed on the command
button, use
the Caption property. At design time, you can set
this
Property by selecting it from the control
Properties
Window. When you set the Caption property at
design
Time, the button text will be updated
dynamically.
You can set the Caption property up to 255 total
characters. If your caption exceeds the width of
the Command button, it will wrap to the next line
However, it will be clipped if the control cannot
accommodate its overall height.
24 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
You can change the font displayed on the
command button by setting its Font property.
Creating Keyboard Shortcuts
You can use the Caption property to create access
key Shortcuts for your command buttons by
adding an Ampersand (&) before the letter you
want to use as the Access key. For example, to
create an access key for the caption “Print”
you add an ampersand before the
Letter “p” “&print”. At run time, the letter “p”
will be underlined and the user can select the
command by simultaneously pressing ALT+P.
Note: To include an ampersand in a caption
without
Creating an access key, include two ampersands
(&&). A single ampersand is displayed in the
caption and no
Characters are underlined.
25 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Specifying the Default and Cancel Properties
On each form, you can select a button to be
the default command button _ that is,
whenever the user Presses the ENTER key the
command button is clicked
Regardless of which other control on the form
has the Focus. To specify a command button as
default set the Default property to True.
You can also specify a default cancel button.
When the Cancel property of a command
button is set to True, it will be clicked
whenever the user presses the ESC key
regardless of which other control on the form has
the focus.
A command button can be selected at run
time by using the mouse or keyboard in the
following ways:
Use a mouse to click the button.
Move the focus to the button by pressing
the TAB
26 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Key, and then choose the button by pressing
the
SPACEBAR or ENTER.
Press an access key (ALT+ the underlined
letter) for a command button.
If the command button is the default
command button for the form, pressing
ENTER chooses the, even if you change the
focus to a different control.
If the command button is the default cancel
for the form, then pressing ESC chooses the,
even if you change the focus to another
control.
The value property
Whenever the command button is selected, its
value property is set to True and the Click event
is triggered. False (DEFALT) indicates the button
isn’t chosen. You can use the value of property in
code to the command button’s click event. For
example:
cmdClose.Value=True
27 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
The Click Event
When clicked, the button’s Click events is
triggered and the code you have written in the
click event procedure is invoked.
Clicking a command button control also
generates the Mouse Down and Mouse Up
events. If you intend to attach event procedure for
these related events, be sure that their actions
don’t conflict. The order in which these three
Events occur varies from control to control. In the
control,
These events occur in this order: Mouse Down,
Click, Mouse Up.
Note: If the user attempts to double-click the
control, each
click will be processed separately; that is, the
control does
not support the double-click event.
For More Information See, Visual Basic
Books “Responding to Mouse and Keyboard
Events,” for more information on the Mouse
Down and mouse Up events. See
28 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
“Responding to Mouse and Keyboard Events” for
more
information on the Mouse Down and Mouse Up
events.
The easiest way to allow the user to interact with
an application is to provide a button to click. You
can use the command button control provided by
Visual Basic, or you can create your own
“button” using an image control containing a
graphic, such as an icon.
Using Command buttons
Most Visual Basic applications have command
button that allow to user to simply click them to
perform action. When the user chooses the
button, it not only carries out the appropriate
action, it also looks as if it’s being pushed in and
released. Whenever the user clicks a button, the
click event procedure is invoked. You place code
in the click event procedure to perform any action
you choose.
29 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
There are many ways to choose a command
button at run time:
Use a mouse to click the button.
Move the focus to the button by pressing the
TAB key, and then choose the button by
pressing the SPACEBAR or ENTER. (See
“Understanding Focus” later in this chapter.)
Press an access (ALT+the underlined letter)
for a command button.
Set a command button’s value property to
true in code.
cmdClose.Value = true
Invoke the command button’s Click event in
code.
cmdClose_Click
If the command button is the default
command button for the form, pressing
30 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
ENTER chooses the button even if you
change the focus to a different control than a
command button. At design time, you specify
a default command button by setting that
button’s Default property to True.
If the command button is the default cancel
button for the form, then pressing ESC
chooses the button, even if you change the
focus to another control. At design time, you
specify a default Cancel button by setting that
button’s Cancel property to True.
All these action cause Visual Basic to invoke the
Click event procedure.
The Test Buttons Application
You use the caption property to display text on
the button to tell the user what the button does. In
Figure 3.4,the Test Button example from the
Control sample application
Contains a command button with its caption
property set to
31 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
“Change Signal.” (For a working version of this
example, see Button.frm in the controls.vbp
sample application
Combo box:-
A combo box control combines the features of a
text box and a list box. This control allows the
user to select an item either by typing text into
the combo box, or by selecting it form the list.
Combo boxes present a list of choices to the user.
If the number of items exceeds what can be
displayed in the combo box, scroll bars will
automatically appear on the control. The user can
then scroll up and down or left to right through
the list.
When to Use a Combo Box Instead of a List Box
Generally, a combo box is appropriate when there
is a list of suggested choices, and a list box is
appropriate when you want to limit input to what
is on the list. A combo box contains an edit field,
32 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
so choices not on the list can be typed in this
field.
In application, combo boxes save space on a
form. Because the full list is not displayed until
the user clicks the down arrow (except for style I,
which is always dropped down),
a combo box can easily fit in a small space where
a list box would not fit.
For More Information See “Using List Boxes
and Combo Boxes” controls, and Menus,” for a
simple demonstration
of these controls. See” Using List Boxes and
Combo Boxes” in “Forms, Controls, and Menus
“for a simple demonstration of these controls.
Also see “Using the list Box Control” later in this
chapter for more information about the list box
control.
Data-Bound Feature
Visual Basic includes both standard and data-
bound versions of the combo box control. While
both versions allow you to display, edit, and
update information from most standard type of
33 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
database, the data –bound combo box provides
more advanced data access feature. The data-
bound combo box control also supports a
different set of properties and methods than
standard combo box control.
For more information see “using the DataCombo
and DataList Controls” in visual basic books,
“Using Visual Basic’s standard controls”.
Combo Box Styles
There are three combo box styles. Each style can
be set at design time and uses values, or
equivalent Visual Basic constants, to set the style
of the combo box.
Style Value Constant
Drop-Down combo box 0 vbComboDropDown
Simple combo box 1 vbComboSimple
Drop-Down list box 2 vbComboDropDownList
34 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Drop-Down combo box
With the default setting (Style = 0-
DropDownCombo), a combo box is a drop down
combo box. The user can either enter text directly
(as in a text box) or click the detached arrow at
the right of the combo box to open a list of
choices. Selecting one of the choices inserts it
into the text portion at the top of the combo box.
The user also can open the list by pressing ALT +
DOWN ARROW when the control has the focus.
Simple combo box
Setting the style property of a combo box to 1 –
simple combo specifies a simple combo box in
which the list is displayed at all times. To display
all entries in the list, you must draw the list box
large enough to display the entries. A vertical
scroll bar is automatically inserted when there are
more entries that can be displayed. The user can
35 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
still enter text directly or select from a list. As
with a drop-down combo box, a simple combo
box also allows users to enter choices not on the
list.
Drop-Down list box
A drop-down list box (Style = 2 –Dropdown list)
is like a regular list box – it displays a list of
items from which a user must choose. Unlike list
boxes, however, the list is not displayed until you
click the arrow to the right of the box. The key
difference between this and a drop-down combo
box is that the user can’t type into the box; he can
only select an item from the list. Use this type of
list box when space is ata premium.
Adding Items
To add items to a combo box, use the AddItem
method, which has the following syntax:
box.AddItem item[, index]
36 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Argument Description
Box Name of the list or combo box
Item String expression to add to
the list. If item is a literal
constant, enclose it in
quotation marks.
Index Specifies where the new item
is to be inserted in the list.
An index of 0 represents the
first position. If index is
omitted, the item is inserted
at the end (or in the proper
sorted order).
37 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
While list items are commonly added in the
form_ load event procedure, you can use the
AddItem method at any time. This gives you the
ability to add item to the list dynamically (in
response to user action).
The following code places “
Chardonnay” ,“Fume Blanc” ,“Gewurztraminer”,
and
“Zinfandel” into a combo box named combo l
with its Style property set to 0
(vb Combo Drop down):
Private Sub Form _Load()
Combo1.AddItem “Chardonnay”
Combo1.AddItem “Fume Blanc”
Combo1.AddItem “Gewurztraminer”
Combo1.AddItem “Zinfandel”
End Sub
Adding Items at Design Time
You can also enter items into the list at design
time by setting the List property in the properties
window of the combo box control. When you
select the List property option and then click the
down arrow, you can type list items and then
38 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
press the CTRL+ENTER key combination to
start a new line.
You can only add items to the end of the list. So,
if you want to alphabetize the list, set the sorted
property to True. See “Sorting a list” below for
more information.
Adding an Item at a Specified Position
To add an item to a list at a specific position,
specify an index value after the new item. For
example, the next line of code inserts “Pinot
Noir” into the first position, adjusting the position
of the other items downward:
Combo1.AddItem “Pinot Noir”, 0
Sorting a List
You can specify that items be added to a list in
alphabetical order by setting the Sorted Property
to True and omitting the index. The sort is not
case-sensitive; thus, the words “chardonnay” and
“Chardonnay” are treated the same.
39 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
When the sorted property is set to True, using the
AddItem method with the index argument can
lead to unpredictable, unsorted results.
FORMS
AND
40 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
CODING
41 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Public RET As Integer
'Public CON As New ADODB.Connection
'Public rs As New ADODB.Recordset
Public DB As Database
42 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Public RS As Recordset
Private Sub cmdcancel_Click()
MsgBox "Hey!You change your mind han..",
vbExclamation, "Cancel"
TXTUSER.Text = ""
TXTPASS.Text = ""
TXTCPASS.Text = ""
TXTUSER.SetFocus
End Sub
Private Sub cmdext_Click()
MDIForm1.Show
Me.Hide
Unload Me
End Sub
Private Sub cmdok_Click()
43 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Set DB =
DBEngine.Workspaces(0).OpenDatabase("C:\PROJ\db1
.mdb", False, False)
Set RS = DB.OpenRecordset("passcode",
dbOpenDynaset)
While RS.EOF = False
If RS.Fields("user id").Value = TXTUSER.Text Then
MsgBox "User already exist create from another name",
vbCritical, "Error"
'RS.Close
'CON.Close
TXTUSER.Text = ""
TXTPASS.Text = ""
TXTCPASS.Text = ""
TXTUSER.SetFocus
Exit Sub
End If
RS.MoveNext
Wend
If TXTUSER = "" Then
44 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
MsgBox "ENTRY MUST", vbInformation, "BLANK "
'RS.Close
'CON.Close
TXTUSER.SetFocus
Exit Sub
ElseIf TXTPASS = "" Then
MsgBox "ENTRY MUST", vbInformation, "BLANK "
'RS.Close
'CON.Close
TXTPASS.SetFocus
Exit Sub
ElseIf TXTCPASS = "" Then
MsgBox "ENTRY MUST", vbInformation, "BLANK "
'RS.Close
'CON.Close
TXTCPASS.SetFocus
Exit Sub
ElseIf TXTPASS.Text = TXTCPASS.Text Then
RS.AddNew
45 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
RS.Fields("User Id").Value = TXTUSER.Text
RS.Fields("User pass code").Value = TXTPASS.Text
RS.Update
MsgBox "New user has been created", vbInformation,
"User Created"
'RS.Close
'CON.Close
MDIForm1.Show
Me.Hide
Unload Me
Else
MsgBox "Password not retyped correctly", vbCritical,
"Error"
'RS.Close
'CON.Close
TXTCPASS.Text = ""
TXTCPASS.SetFocus
Exit Sub
End If
'RS.Close
'CON.Close
46 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End Sub
Private Sub TXTUSER_Change()
If TXTUSER.Text = "" Then
CMDOK.Enabled = False
Else
CMDOK.Enabled = True
End If
End Sub
47 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command1_Click()
48 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Me.Hide
MDIForm1.Show
End Sub
49 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
50 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub MICNO_Click()
Form3.Show
End Sub
Private Sub MICPW_Click(Index As Integer)
Form9.Show
End Sub
Private Sub MIE_Click()
End
End Sub
Private Sub MIFOS_Click()
Form10.Show
End Sub
Private Sub MIHKS_Click()
Form13.Show
End Sub
51 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub MIKMS_Click()
Form7.Show
End Sub
Private Sub mncnu_Click()
FRMNEWUSER.Show
End Sub
52 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
53 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Public a, X As Integer
Public RS1 As Recordset
Public db1 As Database
Private Sub Form_Activate()
Set db1 = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
'Set rs1 = db1.OpenRecordset("select Max(val(custno))as
a from registration", dbOpenDynaset)
'If rs1.Fields("a").Value >= 1 Then
'X = Val(rs1.Fields("a").Value) + 1
'Else
'X = 1
'End If
'Form4.Text3 = X
'Form12.Text1 = X
'Form11.Text9 = X
End Sub
54 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub List1_Click()
a = List1.ListIndex
If a = 0 Then
Form5.Show
End If
If a = 1 Then
Form4.Show
End If
If a = 2 Then
Form6.Show
End If
If a = 3 Then
Form8.Show
End If
If a = 4 Then
Form5.Show
'DataReport5.Show
End If
If a = 5 Then
Me.Hide
55 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Form9.Show
End If
If a = 6 Then
End
End If
End Sub
56 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
57 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Public DB As Database
Public RS As Recordset
Public RS1 As Recordset
Private Sub Command1_Click()
Form3.Show
Unload Me
End Sub
Private Sub Command2_Click()
Text2.Text = RS.Fields("single").Value
Text4.Text = RS.Fields("doub").Value
Text6.Text = RS.Fields("desd").Value
Text7.Text = RS.Fields("ord").Value
End Sub
Private Sub Form_Activate()
58 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Set RS1 = DB.OpenRecordset("REGISTRATION",
dbOpenDynaset)
Text8.Text = RS1.RecordCount
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set RS = DB.OpenRecordset("room", dbOpenDynaset)
End Sub
59 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
60 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Dim DB, db1, DB2 As Database
Dim RS, RS1, RS2 As Recordset
Public r, ctr, no As Integer
Public x1, s1 As Integer
Public a, b, C, D, E, F As String
Private Sub Command1_Click()
'RS2.AddNew
'RS2.Fields("COUSTNO").Value = Text3
'RS2.Update
RS.AddNew
Text14.SetFocus
'RS2.Fields("cOustno").Value = Text3
RS.Fields("Guest name").Value = Text14
RS.Fields("address").Value = Text13
RS.Fields("city belongs").Value = Text12
RS.Fields("DATE").Value = Text11
61 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
RS.Fields("check in").Value = Text10
If Text9.Visible = True Then
RS.Fields("check out").Value = Text9
End If
RS.Fields("rooms").Value = Combo4
RS.Fields("type room").Value = Combo3
RS.Fields("subcription").Value = Text8
RS.Fields("room no").Value = Text1
RS.Update
If Combo3.Text = "Ordinary" And Combo4.Text =
"double" Then
RS1.MoveFirst
RS1.Edit
RS1.Fields("ord").Value = RS1.Fields("ord").Value + no
RS1.Fields("doub").Value = RS1.Fields("doub").Value +
no
RS1.Update
End If
62 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
If Combo3.Text = "Ordinary" And Combo4.Text =
"single" Then
RS1.MoveFirst
RS1.Edit
RS1.Fields("single").Value = RS1.Fields("single").Value
+ no
RS1.Fields("ord").Value = RS1.Fields("ord").Value +
no
RS1.Update
End If
If Combo3.Text = "Semi-deluxe" And Combo4.Text
= "double" Then
RS1.MoveFirst
RS1.Edit
RS1.Fields("desd").Value =
RS1.Fields("desd").Value + no
RS1.Fields("doub").Value =
RS1.Fields("doub").Value + no
RS1.Update
End If
63 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
If Combo3.Text = "Semi-deluxe" And
Combo4.Text = "single" Then
RS1.MoveFirst
RS1.Edit
RS1.Fields("desd").Value =
RS1.Fields("desd").Value + no
RS1.Fields("single").Value =
RS1.Fields("single").Value + no
RS1.Update
End If
If Combo3.Text = "Deluxe" And Combo4.Text =
"double" Then
RS1.MoveFirst
RS1.Edit
RS1.Fields("desd").Value = RS1.Fields("desd").Value
+ no
RS1.Fields("doub").Value = RS1.Fields("doub").Value
+ no
64 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
RS1.Update
End If
If Combo3.Text = "Deluxe" And Combo4.Text =
"single" Then
RS1.MoveFirst
RS1.Edit
RS1.Fields("desd").Value =
RS1.Fields("desd").Value + no
RS1.Fields("single").Value =
RS1.Fields("single").Value + no
RS1.Update
End If
End Sub
Private Sub Command2_Click()
Label16.Visible = True
Text10.Visible = True
65 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Label15.Visible = False
Text9.Visible = False
End Sub
Private Sub Command3_Click()
RS.MovePrevious
If RS.BOF = False Then
Text14 = RS.Fields("Guest_name").Value
Text13 = RS.Fields("address").Value
Text12 = RS.Fields("city_belongs").Value
Text11 = RS.Fields("date").Value
Text10 = RS.Fields("check_in").Value
Combo4 = RS.Fields("rooms").Value
Combo3 = RS.Fields("type_room").Value
Text8 = RS.Fields("subcription").Value
Text1 = RS.Fields("room_no").Value
Else: a = MsgBox("End of Record", vbInformation +
vbOKOnly, "warning")
End If
End Sub
66 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command4_Click()
RS.MoveNext
If RS.EOF = False Then
Text14 = RS.Fields("Guest name").Value
Text13 = RS.Fields("address").Value
Text12 = RS.Fields("city_belongs").Value
Text11 = RS.Fields("date").Value
Text10 = RS.Fields("check_in").Value
If Text9.Visible = True Then
Text9 = RS.Fields("check_out").Value
End If
Combo4 = RS.Fields("rooms").Value
Combo3 = RS.Fields("type_room").Value
Text8 = RS.Fields("subcription").Value
Text1 = RS.Fields("room_no").Value
Else: a = MsgBox("End of Record", vbInformation +
vbOKOnly, "warning")
End If
End Sub
67 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command5_Click()
End
End Sub
Private Sub Command6_Click()
RS.MoveFirst
x1 = RS.RecordCount
'Form5.Text8.Text = x1
RS.MoveNext
Form3.Show
End Sub
Private Sub Command7_Click()
Label15.Visible = True
Text9.Visible = True
End Sub
Private Sub Form_Activate()
Text11.Text = Format(Now, " m/d/yy")
Text10.Text = Format(Now, "h:m")
68 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Label16.Visible = False
Text10.Visible = False
Label15.Visible = False
Text9.Visible = False
End Sub
Private Sub Form_Deactivate()
Text1 = ""
Text2 = ""
Text3 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text11 = ""
Text12 = ""
Text13 = ""
Text14 = ""
Combo3.Text = ""
Combo4.Text = ""
End Sub
69 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Form_Load()
ctr = 0
no = 1
Set DB = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set RS = DB.OpenRecordset("REGISTRATION",
dbOpenDynaset)
Set db1 = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set RS1 = db1.OpenRecordset("room", dbOpenDynaset)
Set DB2 = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set RS1 = DB2.OpenRecordset("COUSTOMER",
dbOpenDynaset)
End Sub
70 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 32
And KeyAscii <> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub Text10_KeyPress(KeyAscii As Integer)
If KeyAscii > 58 Or KeyAscii < 48 Then
KeyAscii = 0
End If
End Sub
Private Sub Text12_KeyPress(KeyAscii As Integer)
If (KeyAscii < 65 Or KeyAscii > 91) And (KeyAscii < 97
Or KeyAscii > 123) And KeyAscii <> 32 And KeyAscii
<> 8 Then
KeyAscii = 0
End If
71 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End Sub
Private Sub Text14_KeyPress(KeyAscii As Integer)
If (KeyAscii < 65 Or KeyAscii > 91) And (KeyAscii < 97
Or KeyAscii > 123) And KeyAscii <> 32 And KeyAscii
<> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub Text13_KeyPress(KeyAscii As Integer)
If (KeyAscii < 65 Or KeyAscii > 91) And (KeyAscii < 97
Or KeyAscii > 123) And KeyAscii <> 32 And KeyAscii
<> 8 Then
KeyAscii = 0
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii < 46 Or KeyAscii > 58 And KeyAscii <> 32
And KeyAscii <> 8 Then
KeyAscii = 0
72 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End If
End Sub
Private Sub Text9_KeyPress(KeyAscii As Integer)
If KeyAscii < 46 Or KeyAscii > 58 Then
KeyAscii = 0
End If
End Sub
73 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
74 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Public X, sn As Integer
Public DB, db1 As Database
Public RS, RS1 As Recordset
Private Sub Form_Load()
Set DB = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set RS = DB.OpenRecordset("coustomer",
dbOpenDynaset)
End Sub
Private Sub List1_Click()
a = List1.ListIndex
If a = 0 Then
Form16.Show
End If
If a = 1 Then
sn = 1
Form12.Show
End If
If a = 2 Then
Form11.Show
75 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End If
If a = 3 Then
Form3.Show
End If
If a = 4 Then
End
End If
If a = 5 Then
End If
End Sub
76 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
77 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command1_Click()
Me.Hide
MDIForm1.Show
End Sub
Private Sub Frame2_DragDrop(Source As Control, X As
Single, Y As Single)
End Sub
78 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
79 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Dim sql As String
Public str As String
Public tm As Integer
Public amt, gt As Integer
Public CON As New ADODB.Connection
Public DB, db1, DB2, db3, db4 As Database
Public RS, RS1, RS2, rs3, rs4 As Recordset
Private Sub Command1_Click()
Form3.Show
Me.Hide
End Sub
Private Sub Command2_Click()
sql = "select * from registration where room_no=" + "'"
+ Text2.Text + "'"
Set RS = DB.OpenRecordset(sql, dbOpenDynaset)
Text14.Text = RS.Fields("Guest name").Value
Text13.Text = RS.Fields("address").Value
80 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Text12.Text = RS.Fields("city belongs").Value
Text11.Text = RS.Fields("date").Value
Text10.Text = RS.Fields("check_in").Value
Combo4.Text = RS.Fields("rooms").Value
Combo3.Text = RS.Fields("type room").Value
Text1.Text = RS.Fields("room no").Value
Text8.Text = RS.Fields("subcription").Value
End Sub
Private Sub Command3_Click()
Text4.Text = Format(Now, " m/d/yy")
Text9.Text = Format(Now, "h:m")
Text3 = CDate(Text4.Text) - CDate(Text11.Text)
If Combo4.Text = "single" And Combo3.Text =
"Ordinary" Then
tm = Val(Text3.Text) * 500
Text5.Text = tm - Val(Text8.Text)
gt = tm - Val(Text8.Text)
81 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End If
If Combo4.Text = "single" And Combo3.Text =
"Deluxe" Or Combo3.Text = "Semi-deluxe" Then
tm = Val(Text3.Text) * 1000
Text5.Text = tm - Val(Text8.Text)
gt = tm - Val(Text8.Text)
End If
If Combo4.Text = "single" And Combo3.Text = "Semi-
deluxe" Or Combo3.Text = "Semi-deluxe" Then
tm = Val(Text3.Text) * 1000
Text5.Text = tm - Val(Text8.Text)
gt = tm - Val(Text8.Text)
End If
82 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
If Combo4.Text = "double" And Combo3.Text =
"Ordinary" Then
tm = Val(Text3.Text) * 700
Text5.Text = tm - Val(Text8.Text)
gt = tm - Val(Text8.Text)
End If
If Combo4.Text = "double" And Combo3.Text =
"Deluxe" Or Combo3.Text = "Semi-deluxe" Then
tm = Val(Text3.Text) * 1500
Text5.Text = tm - Val(Text8.Text)
gt = tm - Val(Text8.Text)
End If
If Combo4.Text = "double" And Combo3.Text = "Semi-
deluxe" Or Combo3.Text = "Semi-deluxe" Then
tm = Val(Text3.Text) * 1500
Text5.Text = tm - Val(Text8.Text)
gt = tm - Val(Text8.Text)
End If
83 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
RS1.Edit
RS1.Fields("check_out").Value = Text9.Text
RS1.Fields("checkoutdate").Value = Text4.Text
RS1.Update
End Sub
Private Sub Command4_Click()
Set rs4 = db4.OpenRecordset("select * from customer
where roomno='" + Text1.Text + "'")
amt = 0
rs4.MoveFirst
Do While Not rs4.EOF
amt = amt + rs4.Fields("amount").Value
Text6.Text = amt
Text7.Text = Val(Text5.Text) + Val(Text6.Text)
rs4.MoveNext
Loop
RS2.AddNew
RS2.Fields("roomno").Value = Text1.Text
RS2.Fields("roomamt").Value = gt
84 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
RS2.Fields("resamt").Value = amt
RS2.Update
End Sub
Private Sub Command5_Click()
str = "select * from bill where roomno='" &
Form8.Text1.Text & "'"
CON.ConnectionString = "dsn=regi"
CON.Open
DataReport1.Show
End Sub
Private Sub Form_Activate()
Set DB = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
sql = "select * from REGISTRATION "
Set RS = DB.OpenRecordset(sql, dbOpenDynaset)
Set db1 = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
85 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Set RS1 = db1.OpenRecordset("registration",
dbOpenDynaset)
Set DB2 = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set RS2 = DB2.OpenRecordset("bill", dbOpenDynaset)
Set db3 = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set rs3 = db3.OpenRecordset("coustomer",
dbOpenDynaset)
Set db4 = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
RS.MoveFirst
While RS.EOF <> True
Combo3.AddItem RS.Fields("guest name").Value
RS.MoveNext
Wend
Combo3.Clear
Combo4.Clear
86 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Label5.Caption = Format(Now, " m/d/yy")
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As
Single, Y As Single)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii < 65 Or KeyAscii > 91) And (KeyAscii < 97
Or KeyAscii > 123) Then
KeyAscii = 0
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If (KeyAscii < 65 Or KeyAscii > 91) And (KeyAscii < 97
Or KeyAscii > 123) Then
KeyAscii = 0
End If
87 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii > 57 Or KeyAscii < 48 Then
KeyAscii = 0
End If
End Sub
88 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
89 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Public ctr, a, b As Integer
Dim DB As Database
Dim RS As Recordset
Private Sub Command1_Click()
RS.MoveFirst
While RS.EOF <> True
If Text1 = RS.Fields("User Id").Value And Text2 =
RS.Fields("User pass code").Value Then
If Text3.Text = Text4.Text Then
RS.Edit
RS.Fields("user pass code").Value = Text4.Text
RS.Update
ctr = 1
End If
End If
RS.MoveNext
Wend
If ctr = 0 Then
90 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
b = MsgBox("The password you typed do not
match,Type the new password in both text boxes",
vbExclamation, "Change password")
End If
If ctr = 1 Then
a = MsgBox("Your password has been changed")
End If
If a = 1 Then
Me.Hide
Form3.Show
End If
End Sub
Private Sub Command2_Click()
Me.Hide
MDIForm1.Show
End Sub
Private Sub Command3_Click()
End
91 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End Sub
Private Sub Command4_Click()
Me.Hide
MDIForm1.Show
End Sub
Private Sub Form_Load()
ctr = 0
Text1.Text = Form2.Text3.Text
Set DB = OpenDatabase("C:\PROJ\DB1.mdb", False,
False)
Set RS = DB.OpenRecordset("passcode",
dbOpenDynaset)
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As
Single, Y As Single)
End Sub
92 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
93 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command1_Click()
Me.Hide
MDIForm1.Show
End Sub
Private Sub Form_Load()
End Sub
94 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
95 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Public CON As New ADODB.Connection
Public con1 As New ADODB.Connection
Public DB2 As Database
Public RS2 As Recordset
Public RS As Recordset
Public DB As Database
Public str, str1 As String
Public ctr As Integer
Private Sub Combo1_Click()
RS.MoveFirst
While RS.EOF = False
If Combo1.Text = RS.Fields("roomno").Value Then
Text8.Text = RS.Fields("cOustno").Value
Text9.Text = RS.Fields("cOustno").Value
End If
RS.MoveNext
Wend
End Sub
96 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command1_Click()
RS2.MoveFirst
While RS2.EOF = False
Combo1.Text = RS2.Fields("room_no").Value
Combo1.AddItem (Combo1.Text)
RS2.MoveNext
Wend
'Combo2.Visible = False
'rs s.AddNew
'rs.Fields("billno").Value = Text8
'rs.Fields("no of guest").Value = Text1
'rs.Fields("address").Value = Text3
'rs.Fields("citybelongs").Value = Text5
'rs.Fields("roomno").Value = Text7
'rs.Fields("total").Value = Form12.Text8
'rs.Update
'Text8 = ""
'Text1 = ""'
'Text3 = ""
'Text5 = ""
97 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
'Text7 = ""
End Sub
Private Sub Command2_Click()
str = "select * from cOustomer where roomno='" &
Form11.Combo1.Text & "'"
CON.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.3.51;Persist Security
Info=False;Data Source=C:\PROJ\regi.mdb"
CON.Open
Form15.Show
End Sub
Private Sub Command3_Click()
CON.Close
End Sub
Private Sub Command4_Click()
str1 = "select * from cOustomer where tableno=" &
Form11.Text1.Text
98 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
'ctr = 1
con1.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.3.51;Persist Security
Info=False;Data Source=C:\PROJ\regi.mdb"
con1.Open
DataReport4.Show
End Sub
Private Sub Command5_Click()
con1.Close
End Sub
Private Sub Command6_Click()
Me.Hide
Form6.Show
End Sub
Private Sub Form_Load()
99 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
ctr = 0
Set DB2 = OpenDatabase("C:\PROJ\REGI.mdb", False,
False)
Set RS2 = DB2.OpenRecordset("REGISTRATION",
dbOpenDynaset)
Set DB = OpenDatabase("C:\PROJ\REGI.mdb", False,
False)
Set RS = DB.OpenRecordset("coustomer",
dbOpenDynaset)
End Sub
100 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
101 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Dim tm, C As Long
Dim I, r As Integer
Public DB As Database
Public DB2 As Database
Public RS As Recordset
Public RS2 As Recordset
Dim db1 As Database
Dim RS1 As Recordset
Public str As String
Private Sub Combo1_Click()
RS1.MoveFirst
While RS1.EOF = False
If Combo1.Text = RS1.Fields("item_name").Value Then
Text7.Text = RS1.Fields("item_price").Value
End If
RS1.MoveNext
Wend
End Sub
102 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command1_Click()
'Static I, C As Integer
'rs2.AddNew
'rs2.Fields("custno").Value = Form12.Text1
'rs2.Update
'R = INPUTBOX
'Set RS = DB.OpenRecordset("SELECT * FROM
COUSTOMER WHERE COUSTNO=" & r,
dbOpenDynaset)
RS.AddNew
RS.Fields("coustno").Value = Text1
RS.Fields("sno").Value = Form6.sn
Form6.sn = Form6.sn + 1
If Combo2.Visible = True Then
RS.Fields("roomno").Value = Combo2.Text
End If
If Text2.Visible = True Then
RS.Fields("tableno").Value = Val(Text2.Text)
103 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End If
RS.Fields("itemcode").Value = Text5.Text
RS.Fields("quantity").Value = Val(Text6.Text)
RS.Fields("price").Value = Val(Text7.Text)
RS.Fields("itemname").Value = Combo1.Text
RS.Fields("amount").Value = Val(Text7.Text) *
Val(Text6.Text)
RS.Update
End Sub
Private Sub Command2_Click()
'Form11.Text7 = Form12.Combo2.Text
'Form11.Text1 = Form12.Combo3.Text
'Form11.Text9 = Form12.Text1
Form11.Show
'str = "select * from customer where cust no='" &
Form11.Text9.Text & "'"
'con.ConnectionString = "dsn=regi"
'con.Open
'DataReport3.Show
End Sub
104 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command3_Click()
'Text4.Visible = True
Text2.Visible = True
Label4.Visible = True
Combo2.Visible = False
Label8.Visible = False
'Text4.SetFocus
'rs.Edit
'rs.Fields("tableno").Value = Text2.Text
'rs.Update
'rs.MoveFirst
'While rs.EOF = False
'Combo3.Text = rs.Fields("tableno").Value
'Combo3.AddItem (Combo3.Text)
'rs.MoveNext
'Wend
End Sub
Private Sub Command4_Click()
105 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Text2.Visible = False
Combo2.Visible = True
Label8.Visible = True
'Combo3.Visible = False
Text2.Visible = False
Label4.Visible = False
RS2.MoveFirst
While RS2.EOF = False
Combo2.Text = RS2.Fields("room no").Value
Combo2.AddItem (Combo2.Text)
RS2.MoveNext
Wend
End Sub
Private Sub Command5_Click()
Me.Hide
Form6.Show
End Sub
106 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command6_Click()
Me.Hide
Form3.Show
End Sub
Private Sub Form_Load()
C=0
Set DB = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set RS = DB.OpenRecordset("coustomer",
dbOpenDynaset)
Set DB2 = OpenDatabase("C:\PROJ\regi.mdb", False,
False)
Set RS2 = DB2.OpenRecordset("registration",
dbOpenDynaset)
Set db1 = OpenDatabase("C:\PROJ\menu.mdb", False,
False)
Set RS1 = db1.OpenRecordset("resmenu1 ",
dbOpenDynaset)
107 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Label5.Caption = Format(Now, " m/d/yy")
Label12.Caption = Format(Now, "h:m")
I=1
r=2
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift
As Integer)
If KeyCode = 13 Then
Combo1.Clear
RS1.MoveFirst
While RS1.EOF = False
If Text5.Text = RS1.Fields("item_id").Value Then
Combo1.Text = RS1.Fields("item_name").Value
Combo1.AddItem (Combo1.Text)
End If
RS1.MoveNext
Wend
End If
End Sub
108 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
109 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command1_Click()
Me.Hide
MDIForm1.Show
End Sub
Private Sub Form_Load()
End Sub
110 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
111 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Private Sub Command1_Click()
Me.Hide
MDIForm1.Show
End Sub
Private Sub Label8_Click()
End Sub
112 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
113 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Dim CON As New ADODB.Connection
Dim RS As New ADODB.Recordset
Private Sub Command1_Click()
RS.MoveFirst
Text1.Text = RS.Fields("GUESTNAME").Value
Text2.Text = RS.Fields("ROOMNO").Value
Text3.Text = RS.Fields("ADDRESS").Value
Text4.Text = RS.Fields("CITY").Value
Text5.Text = RS.Fields("DATE").Value
Text6.Text = RS.Fields("ROOMS").Value
Text7.Text = RS.Fields("CHECKIN").Value
Text8.Text = RS.Fields("CHECKOUT").Value
Text9.Text = RS.Fields("SUBSCRIPTION").Value
End Sub
Private Sub Form_Load()
114 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
CON.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.3.51;Persist Security
Info=False;Data Source=C:\PROJ\regi.mdb"
CON.Open
RS.Open "SELECT * FROM REGISTRATION", CON,
adOpenKeyset, adLockPessimistic
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As
Single, Y As Single)
End Sub
115 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
116 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Dim DB As Database
Dim RS As Recordset
Private Sub Command1_Click()
RS.MoveFirst
If RS.BOF = True Then
MsgBox " UR ON THE FIRST RECORD"
Command1.Enabled = False
Else
Text1.Text = RS.Fields("ROOMNO").Value
Text2.Text = RS.Fields("TABLENO").Value
Text3.Text = RS.Fields("SNO").Value
Text4.Text = RS.Fields("COUSTNO").Value
Text5.Text = RS.Fields("AMOUNT").Value
Text6.Text = RS.Fields("ITEMNAME").Value
Text7.Text = RS.Fields("PRICE").Value
Text8.Text = RS.Fields("QUANTITY").Value
Text9.Text = RS.Fields("ITEMCODE").Value
End If
117 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End Sub
Private Sub Command2_Click()
RS.MoveNext
If RS.EOF = True Then
MsgBox "U R ON THE LAST RECORD"
RS.MoveLast
Else
Text1.Text = RS.Fields("ROOMNO").Value
Text2.Text = RS.Fields("TABLENO").Value
Text3.Text = RS.Fields("SNO").Value
Text4.Text = RS.Fields("COUSTNO").Value
Text5.Text = RS.Fields("AMOUNT").Value
Text6.Text = RS.Fields("ITEMNAME").Value
Text7.Text = RS.Fields("PRICE").Value
Text8.Text = RS.Fields("QUANTITY").Value
Text9.Text = RS.Fields("ITEMCODE").Value
End If
118 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
End Sub
Private Sub Command3_Click()
RS.MoveLast
Text1.Text = RS.Fields("ROOMNO").Value
Text2.Text = RS.Fields("TABLENO").Value
Text3.Text = RS.Fields("SNO").Value
Text4.Text = RS.Fields("COUSTNO").Value
Text5.Text = RS.Fields("AMOUNT").Value
Text6.Text = RS.Fields("ITEMNAME").Value
Text7.Text = RS.Fields("PRICE").Value
Text8.Text = RS.Fields("QUANTITY").Value
Text9.Text = RS.Fields("ITEMCODE").Value
End Sub
Private Sub Command4_Click()
RS.MovePrevious
If RS.BOF = True Then
MsgBox " U R ON THE FIRST RECORD"
RS.MoveFirst
Else
119 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
Text1.Text = RS.Fields("ROOMNO").Value
Text2.Text = RS.Fields("TABLENO").Value
Text3.Text = RS.Fields("SNO").Value
Text4.Text = RS.Fields("COUSTNO").Value
Text5.Text = RS.Fields("AMOUNT").Value
Text6.Text = RS.Fields("ITEMNAME").Value
Text7.Text = RS.Fields("PRICE").Value
Text8.Text = RS.Fields("QUANTITY").Value
Text9.Text = RS.Fields("ITEMCODE").Value
End If
End Sub
Private Sub Command5_Click()
Form3.Show
Me.Hide
End Sub
Private Sub Form_Load()
Set DB = OpenDatabase("C:\PROJ\REGI.MDB")
Set RS = DB.OpenRecordset("COUSTOMER",
dbOpenDynaset)
End Sub
120 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »
Downloaded from Studynama.com. Click to download unlimited free college projects »
BIBLIOGRAPHY
THESE BOOKS HAVE BEEN VERY USEFUL IN
MAKING THIS PROJECT
PROGRAMMING IN VISUAL BASIC
-Black book
&
MASTERING VISUAL BASIC 6
-Evangelos Petroutsos
121 | P a g e
Downloaded from Studynama.com. Click to download unlimited free college projects »