📄 main_ysbb.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form main_ysbb
BorderStyle = 3 'Fixed Dialog
Caption = "登记预收报表"
ClientHeight = 5820
ClientLeft = 45
ClientTop = 555
ClientWidth = 11070
Icon = "main_ysbb.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5820
ScaleWidth = 11070
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Caption = "输入查询条件"
Height = 825
Left = 0
TabIndex = 1
Top = 0
Width = 9480
Begin MSComCtl2.DTPicker DTPstart
Height = 375
Left = 480
TabIndex = 5
Top = 240
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
Format = 171507713
CurrentDate = 38710
End
Begin VB.CommandButton cmdClose
Caption = "关闭(&C)"
Height = 360
Left = 8265
TabIndex = 4
Top = 255
Width = 1155
End
Begin VB.CommandButton cmdSearch
Caption = "搜索(&S)"
Height = 360
Left = 5895
TabIndex = 3
Top = 240
Width = 1155
End
Begin VB.CommandButton cmdPrint
Caption = "打印(&P)"
Height = 360
Left = 7050
TabIndex = 2
Top = 255
Width = 1155
End
Begin MSComCtl2.DTPicker DTPend
Height = 375
Left = 2280
TabIndex = 7
Top = 240
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
Format = 171507713
CurrentDate = 38710
End
Begin VB.Label Label1
Caption = "到"
Height = 255
Left = 2040
TabIndex = 6
Top = 360
Width = 255
End
End
Begin MSFlexGridLib.MSFlexGrid Grid1
Height = 4875
Left = 0
TabIndex = 0
Top = 840
Width = 10935
_ExtentX = 19288
_ExtentY = 8599
_Version = 393216
Cols = 8
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 = "main_ysbb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'FIXIT: 使用 Option Explicit 可以避免隐式创建 Variant 类型的变量 FixIT90210ae-R383-H1984
Public mysq As String
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdPrint_Click()
If MsgBox("确认打印报表吗? ", vbInformation + vbYesNo, "hello") = vbNo Then Exit Sub
Dim myPage As PageSetting
myPage.sngPageHeight = 260
myPage.sngPageWidth = 190
myPage.sngPageTop = 15
myPage.sngPageLeft = 4
myPage.sngDirect = 1 '1纵向2横向
PrintPage myPage, "预收款查询", "查询日期:" & Date, "华成酒店管理系统", "制作: ", Grid1, "0,1,2,3,4,5,6,7", 10, 1
End Sub
Private Sub cmdSearch_Click()
'如果为日期时
mysq = "Select * from djb Where 住宿日期 >=#" & DTPstart.Value & "# And 住宿日期<=#" & DTPend.Value & "# And 标志 = '1'"
'住宿日期 = #" & dtpStart.Value & "# And >=#" & dtpStart.Value & "# And 销售表.回款日期<=#" & dtpEnd.Value & "#
SearchIt
'
End Sub
Private Sub SearchIt()
'检索数据
Dim db As Database
Dim EF As Recordset
Set db = OpenDatabase(ConData, False, False, Constr)
Set EF = db.OpenRecordset(mysq, dbOpenDynaset)
Dim curSumMoney As Currency
Dim curSumQuanty As Currency
curSumMoney = 0
curSumQuanty = 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("预收金额") _
& vbTab & EF("摘要") & vbTab & EF("应收宿费")
curSumMoney = curSumMoney + EF("应收宿费")
curSumQuanty = curSumQuanty + EF("预收金额")
EF.MoveNext
Loop
End If
'添加合计
Grid1.AddItem "" & vbTab & " 合 计 " & vbTab & "" _
& vbTab & "" & vbTab & vbTab & curSumQuanty & vbTab & "" _
& vbTab & curSumMoney & vbTab & ""
'更换最后一行颜色
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -