Hotel Management System in Visual Basic 6.0

The Hotel Management System is a project created using Microsoft Visual Basic 6.0. It basically works like any other professional software. This project consists of four forms.
1) A Splash screen to enter into the software.
2) A login page which  a username and password combo to gain access into the
    software
3) A Check-in page
4) A Check-out page

Form No.1 ( Splash Screen )

A splash screen can be created from the "ADD FORM" button on the upper toolbar.


Below is the VB code for the splash screen :

Private Sub Command1_Click()
Form1.Show
Me.Hide
Unload Me
End Sub

Private Sub Command2_Click()
Unload Me

End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
    Unload Me
End Sub

Private Sub Form_Load()
    lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision   
End Sub

Private Sub Frame1_Click()
    Unload Me
End Sub



Form No. 2 ( Login Page)

This  page requires a username and password combo to gain access into the software.


Below is the VB code for the login page :

Private Sub Command1_Click()
If (Text1.Text = "park" And Text2.Text = "hotel") Then
Form2.Show
Me.Hide
Else
 MsgBox "Incorrect username or password"
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
End Sub


Form No. 3  (Check In Page) 


The check-in page requires a customer to fill up their necessary information.

 

Below is the VB code for the check-in page :

Private Sub Command1_Click()
If (Text8.Text = "Occupied") Then
MsgBox "Room Occupied!!"
Else
Text8.Text = "Occupied"
MsgBox "Checked In Successfully"
End If
End Sub

Private Sub Command2_Click()
Unload Me

End Sub

Private Sub Command3_Click()
Form3.Show
Unload Me
End Sub

Private Sub Form_Load()

End Sub

Private Sub Timer1_Timer()
Label25.Caption = Time
End Sub


Form No.4 ( Check-out page)

The check out page automatically shows all the details of the guest. After check out, all the details of the guest are permanently deleted.


Below is the VB Code for the check-out page :

Private Sub Command1_Click()
Form2.Show
Me.Hide
End Sub

Private Sub Command3_Click()
If (Text14.Text = "Vacant") Then
MsgBox "Room Vacant!!"
Me.Hide
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text14.Text = "Vacant"
MsgBox "Checked Out Successfully"
Form2.Show
Unload Me
End If
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Label1_Click()

End Sub

Keep in mind that the data scrollbar in the check-in and check-out page have to be linked to the your MS-Access Database File.

Otherwise, the data update in both the check-in and check-out page will not take place.

The fields used in the access database file are provided below :


 If you are unsure of about how to connect the database file to VB, then click here.


Top