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

📄 form18.frm

📁 利用VB编写的一个完整的酒店管理程序,支持双数据库!
💻 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 Form18 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "日营业报表"
   ClientHeight    =   4995
   ClientLeft      =   45
   ClientTop       =   315
   ClientWidth     =   9735
   LinkTopic       =   "Form18"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4995
   ScaleWidth      =   9735
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Frame1 
      Caption         =   "输入查询条件"
      Height          =   795
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   6600
      Begin VB.CommandButton cmdClose 
         Caption         =   "关闭(&C)"
         Height          =   360
         Left            =   5160
         TabIndex        =   3
         Top             =   240
         Width           =   1155
      End
      Begin VB.CommandButton cmdSearch 
         Caption         =   "搜索(&S)"
         Height          =   360
         Left            =   2640
         TabIndex        =   2
         Top             =   240
         Width           =   1155
      End
      Begin VB.CommandButton cmdPrint 
         Caption         =   "打印(&P)"
         Height          =   360
         Left            =   3840
         TabIndex        =   1
         Top             =   240
         Width           =   1155
      End
      Begin MSComCtl2.DTPicker DTPstart 
         Height          =   375
         Left            =   600
         TabIndex        =   4
         Top             =   240
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   661
         _Version        =   393216
         Format          =   171507713
         CurrentDate     =   38710
      End
   End
   Begin MSFlexGridLib.MSFlexGrid Grid1 
      Height          =   3795
      Left            =   120
      TabIndex        =   5
      Top             =   960
      Width           =   9375
      _ExtentX        =   16536
      _ExtentY        =   6694
      _Version        =   393216
      Cols            =   14
      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 = "Form18"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'FIXIT: 使用 Option Explicit 可以避免隐式创建 Variant 类型的变量                                          FixIT90210ae-R383-H1984
Public Strel As String
Public Sctt As String

Public Scttf As String
Private Sub cmdClose_Click()
Unload Me
End Sub

Private Sub Form_Load()
checkPath ""
DTPstart.Value = Date - 1
Strel = "Select * from tfd where 退房日期 =#" & DTPstart.Value & "# "
SearchIt
End Sub
Private Sub cmdPrint_Click()

 If MsgBox("确认打印报表吗?  ", vbInformation + vbYesNo, "hello") = vbNo Then Exit Sub
 
 Dim myPage As PageSetting
     myPage.sngPageHeight = 190
     myPage.sngPageWidth = 260
     myPage.sngPageTop = 15
     myPage.sngPageLeft = 4
     myPage.sngDirect = 2       '1纵向2横向
     
 PrintPage myPage, "日营业报表", "查询日期:" & Date, "华成酒店管理系统", "制作:  ", Grid1, "0,1,2,3,4,5,6,7,8,9,10,11,12,13", 10, 1
 
End Sub

Private Sub cmdSearch_Click()

 '如果为日期时
 
    Strel = "Select * from tfd where 退房日期 =#" & DTPstart.Value & "# "
    '住宿日期 = #" & dtpStart.Value & "#   And>=#" & dtpStart.Value & "# And 销售表.回款日期<=#" & dtpEnd.Value & "#
   ' Sctt = "Select * from tfd where 退房日期=#" & DTPend.Value & "# and 时间<=#" & tim3.Value & "#"
    
    '住宿日期 = #" & dtpStart.Value & "#   And>=#" & dtpStart.Value & "# And 销售表.回款日期<=#" & dtpEnd.Value & "#
  '退房日期<=#" & DTPend.Value & "#
 ' Strel = "Select * from tfd where (退房日期 >=#" & DTPstart.Value & "# and 时间>=#" & tim2.Value & "# ) or ( 退房日期<=#" & DTPend.Value & "# and 时间<=#" & tim3.Value & "#)"
  
  
  
  SearchIt
 ' Inner Join 产品库 ON
End Sub

Private Sub SearchIt()

 '检索数据
  Dim db As Database
  Dim EF As Recordset
  Set db = OpenDatabase(ConData, False, False, Constr)
  Set EF = db.OpenRecordset(Strel, 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
 Dim Fjs As Integer
      curSumMoney = 0
      curSumQuanty = 0
       curSumMone = 0
      curSumQuant = 0
       curSumMon = 0
      curSumQuan = 0
       curSumMo = 0
     Fjs = 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("杂费") & vbTab & EF("电话费") & vbTab & EF("会议费") & vbTab & EF("存车费") & vbTab & EF("赔偿费") & vbTab & EF("金额总计")
            curSumMoney = curSumMoney + EF("杂费")
            curSumQuanty = curSumQuanty + EF("应收宿费")
            curSumMone = curSumMone + EF("电话费")
            curSumQuant = curSumQuant + EF("会议费")
            curSumMon = curSumMon + EF("存车费")
            curSumQuan = curSumQuan + EF("赔偿费")
            curSumMo = curSumMo + EF("金额总计")
            Fjs = EF.Fields.Count
            
            EF.MoveNext
         Loop
      End If
      
 '添加合计
  Grid1.AddItem "" & vbTab & "  合  计 " & vbTab & "" _
                     & vbTab & "" & vbTab & vbTab & vbTab & curSumQuanty & vbTab & "" _
                       & curSumMoney & vbTab & curSumMone & vbTab & curSumQuant & vbTab & curSumMon & vbTab & curSumQuan & vbTab & curSumMo & ""
  
  
  
 ' 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 + -