📄 lvketuifang.frm
字号:
VERSION 5.00
Begin VB.Form lvketuifang
Caption = "旅客退房"
ClientHeight = 5340
ClientLeft = 60
ClientTop = 345
ClientWidth = 7620
Icon = "lvketuifang.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5340
ScaleWidth = 7620
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame5
Height = 855
Left = 0
TabIndex = 20
Top = 4440
Width = 7575
Begin VB.CommandButton Command3
Caption = "返回"
Height = 500
Left = 4680
TabIndex = 22
Top = 240
Width = 1000
End
Begin VB.CommandButton Command2
Caption = "结帐"
Height = 500
Left = 1320
TabIndex = 21
Top = 240
Width = 1000
End
End
Begin VB.Frame Frame4
Caption = "结帐"
Height = 735
Left = 0
TabIndex = 17
Top = 3600
Width = 7575
Begin VB.TextBox Text9
Height = 300
Index = 3
Left = 4680
TabIndex = 34
Top = 240
Width = 1815
End
Begin VB.TextBox Text9
Height = 300
Index = 2
Left = 1320
TabIndex = 33
Top = 240
Width = 1815
End
Begin VB.Label Label14
Caption = "总金额:"
Height = 255
Left = 3600
TabIndex = 19
Top = 240
Width = 735
End
Begin VB.Label Label13
Caption = "住宿人数:"
Height = 255
Left = 240
TabIndex = 18
Top = 360
Width = 855
End
End
Begin VB.Frame Frame3
Caption = "收费情况"
Height = 1095
Left = 0
TabIndex = 11
Top = 2400
Width = 7575
Begin VB.TextBox Text9
Height = 300
Index = 1
Left = 4680
TabIndex = 32
Top = 600
Width = 1815
End
Begin VB.TextBox Text10
Height = 300
Left = 4680
TabIndex = 31
Top = 240
Width = 1815
End
Begin VB.TextBox Text9
Height = 300
Index = 0
Left = 1320
TabIndex = 30
Top = 600
Width = 1815
End
Begin VB.TextBox Text8
Height = 300
Left = 1320
TabIndex = 29
Top = 240
Width = 1815
End
Begin VB.Label Label12
Caption = "/每人每晚"
Height = 255
Left = 6480
TabIndex = 16
Top = 720
Width = 855
End
Begin VB.Label Label11
Caption = "收费标准:"
Height = 255
Left = 3600
TabIndex = 15
Top = 600
Width = 855
End
Begin VB.Label Label10
Caption = "房间号码:"
Height = 255
Left = 3600
TabIndex = 14
Top = 240
Width = 975
End
Begin VB.Label Label9
Caption = "住宿天数:"
Height = 375
Left = 240
TabIndex = 13
Top = 600
Width = 975
End
Begin VB.Label Label8
Caption = "房间类型:"
Height = 255
Left = 240
TabIndex = 12
Top = 240
Width = 975
End
End
Begin VB.Frame Frame2
Caption = "退房人的基本情况"
Height = 1455
Left = 0
TabIndex = 4
Top = 840
Width = 7575
Begin VB.TextBox Text7
Height = 300
Left = 4680
TabIndex = 28
Top = 960
Width = 1815
End
Begin VB.TextBox Text6
Height = 300
Left = 4680
TabIndex = 27
Top = 600
Width = 1815
End
Begin VB.TextBox Text5
Height = 300
Left = 4680
TabIndex = 26
Top = 240
Width = 1815
End
Begin VB.TextBox Text4
Height = 300
Left = 1320
TabIndex = 25
Top = 960
Width = 1815
End
Begin VB.TextBox Text3
Height = 300
Left = 1320
TabIndex = 24
Top = 600
Width = 1815
End
Begin VB.TextBox Text2
Height = 300
Left = 1320
TabIndex = 23
Top = 240
Width = 1815
End
Begin VB.Label Label7
Caption = "证件号码:"
Height = 255
Left = 3600
TabIndex = 10
Top = 960
Width = 855
End
Begin VB.Label Label6
Caption = "籍贯:"
Height = 255
Left = 3600
TabIndex = 9
Top = 600
Width = 495
End
Begin VB.Label Label5
Caption = "性别:"
Height = 255
Left = 3600
TabIndex = 8
Top = 240
Width = 615
End
Begin VB.Label Label4
Caption = "证件名称:"
Height = 255
Left = 240
TabIndex = 7
Top = 960
Width = 855
End
Begin VB.Label Label3
Caption = "住店时间:"
Height = 255
Left = 240
TabIndex = 6
Top = 600
Width = 855
End
Begin VB.Label Label2
Caption = "姓名:"
Height = 255
Left = 240
TabIndex = 5
Top = 240
Width = 735
End
End
Begin VB.Frame Frame1
Height = 735
Left = 0
TabIndex = 0
Top = 0
Width = 7575
Begin VB.CommandButton Command1
Caption = "查询"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6000
TabIndex = 3
Top = 240
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Left = 3000
TabIndex = 2
Top = 240
Width = 2415
End
Begin VB.Label Label1
Caption = "请输入退房人的姓名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 1
Top = 240
Width = 2535
End
End
End
Attribute VB_Name = "lvketuifang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim db As Database
Dim rs As Recordset
Dim a As String
Dim b As Integer
Dim c As Integer
Dim d As String
Set db = OpenDatabase(App.Path & "\旅店登记.mdb")
Set rs = db.OpenRecordset("旅店登记")
Set rs = db.OpenRecordset("select * from 旅店登记 where 姓名='" & Text1.Text & "'")
If rs.EOF = True Then
MsgBox "没有这个人!"
Else
Text2 = rs.Fields(0)
Text3 = rs.Fields(5)
Text4 = rs.Fields(9)
Text5 = rs.Fields(1)
Text6 = rs.Fields(2)
Text7 = rs.Fields(10)
Text8 = rs.Fields(6)
Text9(0) = rs.Fields(11)
Text10 = rs.Fields(7)
Text9(2) = rs.Fields(12)
End If
Set db = OpenDatabase(App.Path & "\客房情况.mdb")
Set rs = db.OpenRecordset("客房情况")
a = "select * from 客房情况 where 客房类型='" & Text8.Text & "' and 客房号码='" & Text10.Text & "'"
If rs.EOF = True And rs.BOF = True Then
MsgBox "客房信息错误!"
Exit Sub
Else
Text9(1) = rs.Fields(10)
End If
End Sub
Private Sub Command2_Click()
Dim db As Database
Dim rs As Recordset '退房时,在客房情况里的剩余房间的加减没有做
Dim d As String
Dim e As String
Dim f As String
Dim a As String
Set db = OpenDatabase(App.Path & "\旅店登记.mdb")
Set rs = db.OpenRecordset("旅店登记")
a = "select 住宿天数,住宿人数,总金额 from 旅店登记 where 姓名='" & Trim(Text2) & "'and 房间号码='" & Trim(Text10) & "'"
If rs.EOF = True Then
MsgBox ""
Else
d = "update 旅店登记 set 住宿天数='" & Text9(0) & "' where 姓名='" & Text2.Text & "'"
db.Execute d
e = "update 旅店登记 set 住宿人数='" & Text9(2) & "' where 姓名='" & Text2.Text & "'"
db.Execute e
f = "update 旅店登记 set 总金额='" & Text9(3) & "' where 姓名='" & Text2.Text & "'"
db.Execute f
rs.Close
End If
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9(0) = ""
Text9(1) = ""
Text9(2) = ""
Text9(3) = ""
End Sub
Private Sub Command3_Click()
caidan.Show
lvketuifang.Hide
End Sub
Private Sub Text9_Change(Index As Integer)
Dim intcount As Integer
Dim p As Double
Dim r As Double
Dim z As Double
Dim Y As Boolean 'boolean为逻辑型
'Dim x As String
Y = True
If (Index = 0 Or Index = 1 Or Index = 2) Then
z = 0
If Trim(Text9(0)) <> "" Then
z = z + CDbl(Text9(0))
End If
If Trim(Text9(1)) <> "" Then
z = z * CDbl(Text9(1))
End If
If Trim(Text9(2)) <> "" Then
z = z * CDbl(Text9(2))
End If
Text9(3) = Format(z, "#0.00")
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -