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

📄 main_xstj.frm

📁 这个原代码书上有,但是我把它做出来,与大家共享,希望大家喜欢
💻 FRM
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form main_xstj 
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "客房销售统计"
   ClientHeight    =   3795
   ClientLeft      =   45
   ClientTop       =   480
   ClientWidth     =   9285
   Icon            =   "main_xstj.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3795
   ScaleWidth      =   9285
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "D:\VB数据库开发实例解析\程序\宾馆客房管理系统\Kfgl.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   345
      Left            =   -450
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "tfd"
      Top             =   2085
      Visible         =   0   'False
      Width           =   1335
   End
   Begin MSDBGrid.DBGrid DBGrid1 
      Bindings        =   "main_xstj.frx":000C
      Height          =   2985
      Left            =   60
      OleObjectBlob   =   "main_xstj.frx":0020
      TabIndex        =   7
      Top             =   690
      Width           =   9195
   End
   Begin VB.TextBox czy 
      BackColor       =   &H80000000&
      BorderStyle     =   0  'None
      Height          =   225
      Left            =   840
      TabIndex        =   3
      Top             =   255
      Width           =   1380
   End
   Begin VB.Frame Frame1 
      Height          =   675
      Left            =   60
      TabIndex        =   0
      Top             =   -15
      Width           =   9180
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   3660
         TabIndex        =   6
         Top             =   225
         Width           =   1560
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0C0C0&
         Caption         =   "确定"
         CausesValidation=   0   'False
         Height          =   345
         Left            =   5610
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   225
         Width           =   1665
      End
      Begin VB.CommandButton Command2 
         BackColor       =   &H00C0C0C0&
         Caption         =   "退出"
         Height          =   345
         Left            =   7290
         Style           =   1  'Graphical
         TabIndex        =   1
         Top             =   225
         Width           =   1665
      End
      Begin VB.Label Label2 
         Caption         =   "操作员:"
         Height          =   300
         Left            =   60
         TabIndex        =   4
         Top             =   285
         Width           =   765
      End
      Begin VB.Label Label1 
         Caption         =   "请选择汇总年份:  "
         Height          =   285
         Left            =   2220
         TabIndex        =   2
         Top             =   285
         Width           =   2385
      End
   End
End
Attribute VB_Name = "main_xstj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()     '自动识别数据库路径
 Data1.DatabaseName = App.Path & "\KFGL.MDB"
End Sub
Private Sub Form_Activate()
 czy.Text = main.StatusBar1.Panels(4).Text     '赋值给czy.text
 '添加年份列表
 For i = 1999 To 2010
  Combo1.AddItem (i) & 年
 Next i
 Combo1.ListIndex = 3
 Data1.RecordSource = "select count(*)as 记录数,sum(应收宿费)as 应收宿费合计,sum(杂费)as 杂费合计,sum(电话费)as 电话费合计 ,sum(会议费)as 会议费合计,sum(存车费)as 存车费合计,sum(赔偿费)as 赔偿费合计,sum(金额总计)as 实收金额合计,sum(预收宿费)as 预收宿费合计,sum(退还宿费)as 退还宿费合计 from tfd where tfd.BZ like " + Chr(34) + Left(Combo1.Text, 4) + "*" + Chr(34) + ""
 Data1.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
 main.Enabled = True
End Sub
Private Sub Command1_Click()     '统计客房销售信息
 Data1.RecordSource = "select count(*)as 记录数,sum(应收宿费)as 应收宿费合计,sum(杂费)as 杂费合计,sum(电话费)as 电话费合计 ,sum(会议费)as 会议费合计,sum(存车费)as 存车费合计,sum(赔偿费)as 赔偿费合计,sum(金额总计)as 实收金额合计,sum(预收宿费)as 预收宿费合计,sum(退还宿费)as 退还宿费合计 from tfd where tfd.BZ like " + Chr(34) + Left(Combo1.Text, 4) + "*" + Chr(34) + ""
 Data1.Refresh
End Sub
Private Sub Command2_Click()
 main.Enabled = True
 Unload Me
End Sub


⌨️ 快捷键说明

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