⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmconferm.frm

📁 An application on Hotel Management System. I developed it for my project during exam time. Any how i
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Caption         =   "Address"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   22
      Top             =   1680
      Width           =   1575
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "Telephone"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   21
      Top             =   3240
      Width           =   1335
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "Email"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2520
      TabIndex        =   20
      Top             =   3240
      Width           =   975
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "Customer No."
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   19
      Top             =   840
      Width           =   1455
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "Registration Date"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   18
      Top             =   4200
      Width           =   2055
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "Date of Arrival"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2520
      TabIndex        =   17
      Top             =   4200
      Width           =   2055
   End
   Begin VB.Label Label8 
      BackStyle       =   0  'Transparent
      Caption         =   "Room No."
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   16
      Top             =   5040
      Width           =   1335
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "Type of Room"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4680
      TabIndex        =   15
      Top             =   4200
      Width           =   2175
   End
   Begin VB.Label Label10 
      BackStyle       =   0  'Transparent
      Caption         =   "Registration Confirmation"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   735
      Left            =   360
      TabIndex        =   14
      Top             =   120
      Width           =   5655
   End
End
Attribute VB_Name = "FrmConferm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim MyDb As Database, MyRs As Recordset
Dim Db As Database, Rs As Recordset
Private Sub UpdateDate()
    Dim Date1 As Date, Date2 As Date
    Dim Date3 As Date, Date4 As Date
    Dim Years As Integer, Months As Integer, Days As Integer
    'set dates
    Date3 = Now
    'set the difference
   ' Date4 = DateAdd("yyyy", 0, DateAdd("m", 0, DateAdd("d", Val(Text1.Text), Date3)))
    Date4 = DateAdd("d", Val(Text9.Text), Date3)
   
    'view the dates for user
    Text11.Text = Format(Date4, "dd/mm/yy")
    'we can't have negative difference: thus check which date is bigger and which is smaller
    If Date3 < Date4 Then
        Date1 = Date3
        Date2 = Date4
    Else
        Date1 = Date4
        Date2 = Date3
    End If
    'view DateDiff results to user
    DateDiffLabel = DateDiff("yyyy", Date1, Date2) & " year(s), " & DateDiff("m", Date1, Date2) & " month(s) and " & DateDiff("d", Date1, Date2) & " day(s)."
    'get years
    Years = DateDiff("yyyy", Date1, Date2)
    'get months and decrease by one if there can't be one complete month by according the days
    Months = DateDiff("m", Date1, Date2) + (Day(Date1) > Day(Date2))
    'decrease years if necessary for the same reason the months were decreased
    Years = Years + ((Months - Years * 12) < 0)
    'rip out extra months
    Months = Months Mod 12
    'get day difference
    Days = DateDiff("d", Date1, Date2) - DateDiff("d", Date1, DateAdd("yyyy", Years, DateAdd("m", Months, Date1)))
    'view the difference for user
    DateDifference = Years & " year(s), " & Months & " month(s) and " & Days & " day(s)."
End Sub

Private Sub UpdateDate2()
    Dim Date1 As Date, Date2 As Date
    Dim Date3 As Date, Date4 As Date
    Dim Years As Integer, Months As Integer, Days As Integer
    'set dates
    Date3 = Now
    'set the difference
   ' Date4 = DateAdd("yyyy", 0, DateAdd("m", 0, DateAdd("d", Val(Text1.Text), Date3)))
    Date4 = DateAdd("d", Val(Text9.Text), Date3)
   
    'view the dates for user
    Text7.Text = Format(Date3, "dd/mm/yy")
    Text11.Text = Format(Date4, "dd/mm/yy")
    'we can't have negative difference: thus check which date is bigger and which is smaller
    If Date3 < Date4 Then
        Date1 = Date3
        Date2 = Date4
    Else
        Date1 = Date4
        Date2 = Date3
    End If
    'view DateDiff results to user
    DateDiffLabel = DateDiff("yyyy", Date1, Date2) & " year(s), " & DateDiff("m", Date1, Date2) & " month(s) and " & DateDiff("d", Date1, Date2) & " day(s)."
    'get years
    Years = DateDiff("yyyy", Date1, Date2)
    'get months and decrease by one if there can't be one complete month by according the days
    Months = DateDiff("m", Date1, Date2) + (Day(Date1) > Day(Date2))
    'decrease years if necessary for the same reason the months were decreased
    Years = Years + ((Months - Years * 12) < 0)
    'rip out extra months
    Months = Months Mod 12
    'get day difference
    Days = DateDiff("d", Date1, Date2) - DateDiff("d", Date1, DateAdd("yyyy", Years, DateAdd("m", Months, Date1)))
    'view the difference for user
    DateDifference = Years & " year(s), " & Months & " month(s) and " & Days & " day(s)."
End Sub


Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Command5_Click()
MyRs.Edit
     MyRs!ARRIVAL = Text7.Text
     MyRs!checkindate = Format(Date, "DD/MM/YY")
     MyRs!CHECKINTIME = Format(Now, "HH:MM:SS AM/PM")
     MyRs!checkoutdate = Text11.Text
     MyRs!CHECKOUTTIME = Format(Now, "HH:MM:SS AM/PM")
     MyRs!ROOMCHARGES = Text12.Text
     MyRs!ADVANCE = Text14.Text
     MyRs!BALANCE = Text15.Text
     MyRs!ROOMNO = Text10.Text
     MyRs!ID = "YES"
     MyRs!CHECKOUTSTATUS = "NOTDONE"
MyRs.Update
   SQL = "select * from ROOMS where ROOMNO='" & List3.Text & "'"
Set Db = DBEngine.Workspaces(0).OpenDatabase("D:\HOTEL\ROOMS\ROOMS.MDB")
Set Rs = Db.OpenRecordset(SQL, dbOpenDynaset)

Rs.Edit
Rs!Status = "OCCUPIED"
Rs.Update
Rs.Close
Db.Close
MsgBox "Registration is Confermed.", vbOKOnly + vbInformation
MyDb.Close
     Text1.Text = ""
     Text2.Text = ""
     Text3.Text = ""
     Text4.Text = ""
     Text5.Text = ""
     Text7.Text = ""
     Text7.Text = ""
     Text6.Text = ""
     Text8.Text = ""
     Text9.Text = ""
     Text10.Text = ""
     Text11.Text = ""
     Text12.Text = ""
     Text13.Text = ""
     Text14.Text = ""
     Text15.Text = ""
Form_Load

End Sub

Private Sub Command6_Click()
FrmRegister.Show
Unload Me
End Sub

Private Sub Command7_Click()
UpdateDate2
End Sub

Private Sub Form_Load()
Dim D
Me.Left = MDIForm1.Left + 1000
Me.Top = MDIForm1.Top + 1000

On Error Resume Next
List2.Clear
D = Format(Now, "dd/mm/yy")
Text6.Text = D
Text7.Text = D

SQL = "select * from CUSTOMER where ID='" & "NO" & "'"
Set MyDb = DBEngine.Workspaces(0).OpenDatabase("D:\HOTEL\CUSTOMER\CUSTOMER.MDB")
Set MyRs = MyDb.OpenRecordset(SQL, dbOpenDynaset)

If MyRs.RecordCount <= 0 Then
Exit Sub
Else
   Do While Not MyRs.EOF
      List2.AddItem MyRs!SL
    MyRs.MoveNext
    Loop
End If
MyDb.Close

End Sub



Private Sub List1_Click()
List1.ListIndex = List3.ListIndex
List1.Visible = False
List3.Visible = False
Text10.Text = List3.Text
List3_Click
End Sub

Private Sub List2_Click()
On Error Resume Next
     List3.Clear
     List1.Clear
     Text1.Text = ""
     Text2.Text = ""
     Text3.Text = ""
     Text4.Text = ""
     Text5.Text = ""
     Text7.Text = ""
     Text7.Text = ""
     Text6.Text = ""
     Text8.Text = ""
     Text9.Text = ""
     Text10.Text = ""
     Text11.Text = ""
     Text12.Text = ""
     Text13.Text = ""
     Text14.Text = ""
     Text15.Text = ""
SQL = "select * from CUSTOMER where SL='" & List2.Text & "'"
Set MyDb = DBEngine.Workspaces(0).OpenDatabase("D:\HOTEL\CUSTOMER\CUSTOMER.MDB")
Set MyRs = MyDb.OpenRecordset(SQL, dbOpenDynaset)
   Text1.Text = MyRs!SL
   Text3.Text = MyRs!ADDRESS
   Text2.Text = MyRs!Name
   Text4.Text = MyRs!TEL
   Text5.Text = MyRs!EMAIL
   Text6.Text = MyRs!REGDATE
   Text7.Text = MyRs!ARRIVAL
   Text8.Text = MyRs!TYPEOFROOM
   Text9.Text = MyRs!NOOFDAYS
   Text7.Text = MyRs!checkindate
   Text10.Text = MyRs!ROOMNO
   Text11.Text = MyRs!checkoutdate
   Text12.Text = MyRs!ROOMCHARGES
   Text14.Text = MyRs!ADVANCE
   Text15.Text = MyRs!BALANCE
   
   SQL = "select * from ROOMS where TYPEOFROOM='" & Text8.Text & "'"
Set Db = DBEngine.Workspaces(0).OpenDatabase("D:\HOTEL\ROOMS\ROOMS.MDB")
Set Rs = Db.OpenRecordset(SQL, dbOpenDynaset)
Do While Not Rs.EOF
        List3.AddItem Rs!ROOMNO
        List1.AddItem Rs!Status
Rs.MoveNext
Loop
Dim DL
'DL = Format(Date, "dd") + Val(Text9.Text) - 1
'Text11.Text = DL & Format(Date, "/mm/yy")

UpdateDate
End Sub

Private Sub List3_Click()
On Error Resume Next
List1.ListIndex = List3.ListIndex
Text10.Text = List3.Text
List3.Visible = False
List1.Visible = False
Text16.Visible = False
 SQL = "select * from ROOMS where TYPEOFROOM='" & Text8.Text & "'"
Set Db = DBEngine.Workspaces(0).OpenDatabase("D:\HOTEL\ROOMS\ROOMS.MDB")
Set Rs = Db.OpenRecordset(SQL, dbOpenDynaset)
  Text12.Text = Rs!Rate
  
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text2.SetFocus
 End If
End Sub


Private Sub Text10_Click()
List3.Visible = True
List1.Visible = True
Text16.Visible = True
End Sub


Private Sub Text12_Change()
 Text13.Text = Val(Text12.Text) * Val(Text9.Text)
End Sub

Private Sub Text14_Change()
Text15.Text = Val(Text13.Text) - Val(Text14.Text)
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text3.SetFocus
 End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text4.SetFocus
 End If
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text5.SetFocus
 End If
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text6.SetFocus
 End If
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text7.SetFocus
 End If
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text8.SetFocus
    
  End If
End Sub

Private Sub Text8_Click()
List1.Visible = True

End Sub

Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    Text9.SetFocus
 End If
End Sub
Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
'   Dim DL
'DL = Format(Date, "dd") + Val(Text9.Text) - 1
'Text11.Text = DL & Format(Date, "/mm/yy")
'Text10.SetFocus
 End If
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -