📄 form33.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form33
BorderStyle = 4 'Fixed ToolWindow
Caption = "客人消费查询"
ClientHeight = 6885
ClientLeft = 45
ClientTop = 315
ClientWidth = 8925
LinkTopic = "Form33"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6885
ScaleWidth = 8925
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 1455
Left = 120
TabIndex = 1
Top = 120
Width = 8535
Begin VB.OptionButton Option2
Caption = "该客房全部消费"
Height = 255
Left = 240
TabIndex = 7
Top = 840
Width = 1815
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 7320
TabIndex = 6
Top = 960
Width = 975
End
Begin VB.CommandButton Command1
Caption = "搜索"
Height = 375
Left = 5880
TabIndex = 5
Top = 960
Width = 1335
End
Begin VB.TextBox Text1
Height = 375
Left = 3000
TabIndex = 3
Top = 540
Width = 2175
End
Begin VB.OptionButton Option1
Caption = "入住客人消费查询"
Height = 255
Left = 240
TabIndex = 2
Top = 240
Width = 1935
End
Begin VB.Label Label1
Caption = "房间号码"
Height = 255
Left = 2040
TabIndex = 4
Top = 600
Width = 855
End
End
Begin MSFlexGridLib.MSFlexGrid Grid1
Height = 4995
Left = 0
TabIndex = 0
Top = 1680
Width = 8775
_ExtentX = 15478
_ExtentY = 8811
_Version = 393216
Cols = 7
FixedCols = 0
RowHeightMin = 350
BackColorFixed = 8438015
BackColorSel = 12640511
ForeColorSel = 0
BackColorBkg = 16777215
FocusRect = 0
HighLight = 2
FillStyle = 1
GridLinesFixed = 1
SelectionMode = 1
AllowUserResizing= 1
FormatString = " 名 称 | 单 价 | 数 量 | 合 计 | 房 间 号 | 日 期 "
End
End
Attribute VB_Name = "Form33"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'FIXIT: 使用 Option Explicit 可以避免隐式创建 Variant 类型的变量 FixIT90210ae-R383-H1984
Dim Hy As String
Private Sub SearchIt()
'检索数据
Dim db As Database
Dim EF As Recordset
Set db = OpenDatabase(ConData, False, False, Constr)
Set EF = db.OpenRecordset(Hy, dbOpenDynaset)
Dim curSumMoney As Currency
Dim curSumQuanty As Currency
Dim curSumMone As Currency
Dim curSumQuant As Currency
Dim curSumMon As Currency
Dim curSumQuan As Currency
Dim curSumMo As Currency
curSumMoney = 0
curSumQuanty = 0
curSumMone = 0
curSumQuant = 0
curSumMon = 0
curSumQuan = 0
curSumMo = 0
Grid1.Rows = 1
'列出记录
If Not (EF.BOF And EF.EOF) Then
Do While Not EF.EOF
Grid1.AddItem EF("名称") & vbTab & EF("单价") _
& vbTab & EF("数量") & vbTab & EF("合计") & vbTab & EF("房间号") _
& vbTab & EF("日期")
curSumMoney = curSumMoney + EF("合计")
curSumQuanty = curSumQuanty + EF("数量")
EF.MoveNext
Loop
End If
'添加合计
Grid1.AddItem "" & " 合 计 " & vbTab & "" _
& vbTab & "" & curSumQuanty & vbTab & "" _
& curSumMoney & ""
Grid1.Row = Grid1.Rows - 1
'Dim X As Integer
' For X = 7 To 0 Step -1
' Grid1.Col = X
' Grid1.CellBackColor = &HE0E0D0
' Next
' Grid1.ColSel = 7
EF.Close
db.Close
End Sub
Private Sub Command1_Click()
If Option1.Value = True Then
Hy = "select * from wpxh where 房间号='" & Text1.Text & "'and 标志='1'"
SearchIt
Else
If Option2.Value = True Then Hy = "select * from wpxh where 房间号='" & Text1.Text & "'"
SearchIt
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -