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

📄 frm_xxtj.frm

📁 采用VB编写的学生订票管理系统 有详细的代码~解压后可以直接使用!~附有使用说明
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Frm_xxtj 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "信息统计"
   ClientHeight    =   4950
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9330
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   4950
   ScaleWidth      =   9330
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame1 
      Height          =   735
      Left            =   30
      TabIndex        =   2
      Top             =   -15
      Width           =   9195
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   570
         TabIndex        =   8
         Top             =   300
         Width           =   1845
      End
      Begin MSComCtl2.DTPicker DTP1 
         Height          =   330
         Left            =   3315
         TabIndex        =   6
         Top             =   285
         Width           =   1500
         _ExtentX        =   2646
         _ExtentY        =   582
         _Version        =   393216
         Format          =   24903681
         CurrentDate     =   39434
      End
      Begin VB.CommandButton Command2 
         Caption         =   "退出"
         Height          =   375
         Left            =   7725
         TabIndex        =   5
         Top             =   225
         Width           =   900
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确定"
         Height          =   375
         Left            =   6390
         TabIndex        =   4
         Top             =   225
         Width           =   900
      End
      Begin VB.Label Label2 
         Caption         =   "车次"
         Height          =   315
         Left            =   90
         TabIndex        =   7
         Top             =   360
         Width           =   825
      End
      Begin VB.Label Label1 
         Caption         =   "日期"
         Height          =   255
         Left            =   2670
         TabIndex        =   3
         Top             =   345
         Width           =   615
      End
   End
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid MS2 
      Height          =   690
      Left            =   15
      TabIndex        =   1
      Top             =   4140
      Width           =   9270
      _ExtentX        =   16351
      _ExtentY        =   1217
      _Version        =   393216
      Rows            =   1
      Cols            =   10
      FixedRows       =   0
      FixedCols       =   0
      _NumberOfBands  =   1
      _Band(0).Cols   =   10
   End
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid MS1 
      Height          =   3315
      Left            =   15
      TabIndex        =   0
      Top             =   825
      Width           =   9240
      _ExtentX        =   16298
      _ExtentY        =   5847
      _Version        =   393216
      _NumberOfBands  =   1
      _Band(0).Cols   =   2
   End
End
Attribute VB_Name = "Frm_xxtj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Private Sub Command1_Click()
    Dim rs As New ADODB.Recordset
    Dim rs1 As New ADODB.Recordset
    MS2.TextMatrix(0, 1) = ""
    MS2.TextMatrix(0, 9) = ""
    MS2.TextMatrix(0, 11) = ""
    If Combo1.Text = "" Then
        Set MS1.DataSource = cnn.Execute("select * from tb_cpyd where 乘坐日期='" & DTP1.Value & "'and 备注='订票'")
        rs.Open "select count(*) as 数量,sum(票价)as 票价1,sum(实际票价) as 实际票价1 from tb_cpyd where 乘坐日期='" & DTP1.Value & "'and 备注='订票'", cnn, adOpenStatic
        If rs.RecordCount > 0 Then
            MS2.TextMatrix(0, 1) = rs.Fields("数量") & "人订票"
            If rs.Fields("票价1") <> "" Then MS2.TextMatrix(0, 9) = rs.Fields("票价1")
            If rs.Fields("实际票价1") <> "" Then MS2.TextMatrix(0, 11) = rs.Fields("实际票价1")
        End If
        rs.Close
    Else
        Set MS1.DataSource = cnn.Execute("select * from tb_cpyd where 车次='" & Combo1.Text & "'and 乘坐日期='" & DTP1.Value & "'and 备注='订票'")
        rs1.Open "select count(*) as 数量,sum(票价)as 票价1,sum(实际票价) as 实际票价1 from tb_cpyd where 车次='" & Combo1.Text & "'and 乘坐日期='" & DTP1.Value & "'and 备注='订票'", cnn, adOpenStatic
        If rs1.RecordCount > 0 Then
            MS2.TextMatrix(0, 1) = rs1.Fields("数量") & "人订票"
            If rs1.Fields("票价1") <> "" Then MS2.TextMatrix(0, 9) = rs1.Fields("票价1")
            If rs1.Fields("实际票价1") <> "" Then MS2.TextMatrix(0, 11) = rs1.Fields("实际票价1")
        End If
        rs1.Close
    End If
End Sub
Private Sub Command2_Click()
    Unload Me
    Frm_main.Show
    Load Frm_main
End Sub
Private Sub Form_Load()
    Dim rs As New ADODB.Recordset
    Dim rs1 As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset
    Dim s, m
    DTP1.Value = Date
    rs.Open "select * from tb_cpyd where 备注='订票'", cnn, adOpenKeyset
    Set MS1.DataSource = rs
    rs.Close
    rs1.Open "select distinct 车次 from tb_ccxx ", cnn, adOpenStatic
    If rs1.RecordCount > 0 Then
        For i = 1 To rs1.RecordCount
            Combo1.AddItem rs1.Fields("车次").Value
            rs1.MoveNext
        Next i
    End If
    rs1.Close
    s = Array(600, 1100, 800, 800, 0, 1000, 800, 800, 700, 700, 800, 800, 0, 0, 0)
    MS1.Cols = 15
    For i = 0 To 14
        MS1.ColWidth(i) = s(i)
    Next i
    MS2.TextMatrix(0, 0) = "合计"
    MS2.Cols = 15
    For i = 0 To 14
        MS2.ColWidth(i) = s(i)
    Next i
    rs2.Open "select count(*) as 数量,sum(票价)as 票价1,sum(实际票价) as 实际票价1 from tb_cpyd where 备注='订票'", cnn, adOpenKeyset, adLockOptimistic
   If rs2.RecordCount > 0 Then
    MS2.TextMatrix(0, 1) = rs2.Fields("数量") & "人订票"
    MS2.TextMatrix(0, 9) = rs2.Fields("票价1")
    MS2.TextMatrix(0, 11) = rs2.Fields("实际票价1")
    End If
    rs2.Close
    Combo1.Text = Combo1.List(0)
End Sub

⌨️ 快捷键说明

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