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

📄 form2.frm

📁 从别处拿来感觉还可以 内容比较多且完备值得大家看一看
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmjf2 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "交费浏览"
   ClientHeight    =   6330
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   11910
   Icon            =   "Form2.frx":0000
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   6330
   ScaleWidth      =   11910
   Begin VB.Frame Frame2 
      Caption         =   "班级"
      Height          =   5895
      Left            =   0
      TabIndex        =   3
      Top             =   360
      Width           =   2655
      Begin MSComctlLib.TreeView TreeView1 
         Height          =   5535
         Left            =   120
         TabIndex        =   4
         Top             =   240
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   9763
         _Version        =   393217
         HideSelection   =   0   'False
         LineStyle       =   1
         Style           =   7
         FullRowSelect   =   -1  'True
         HotTracking     =   -1  'True
         ImageList       =   "ImageList2"
         BorderStyle     =   1
         Appearance      =   1
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "交费浏览"
      Height          =   5895
      Left            =   2685
      TabIndex        =   0
      Top             =   360
      Width           =   9015
      Begin MSFlexGridLib.MSFlexGrid MSF1 
         Height          =   5535
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   8805
         _ExtentX        =   15531
         _ExtentY        =   9763
         _Version        =   393216
         BackColor       =   -2147483624
         BackColorFixed  =   12632256
         ForeColorFixed  =   0
         BackColorSel    =   16777215
         ForeColorSel    =   255
         BackColorBkg    =   -2147483624
         AllowBigSelection=   -1  'True
         SelectionMode   =   1
         AllowUserResizing=   3
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
   End
   Begin MSComctlLib.ImageList ImageList2 
      Left            =   960
      Top             =   0
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   2
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":0442
            Key             =   "class"
            Object.Tag             =   "class"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form2.frx":0772
            Key             =   "cla2"
         EndProperty
      EndProperty
   End
   Begin VB.Label Label1 
      Caption         =   "双击数据即可得到该学生对应的详细交费情况列表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   2760
      TabIndex        =   2
      Top             =   120
      Width           =   4935
   End
End
Attribute VB_Name = "frmjf2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'学生交费浏览
Public maxx As String
Public classtxt As String
Dim num As String
Public Sub jfshowtitle()
    MSF1.Clear
    Dim i As Integer
    With MSF1
        .Cols = 10
        .TextMatrix(0, 1) = "学号"
        .TextMatrix(0, 2) = "姓名"
        .TextMatrix(0, 3) = "班级"
        .TextMatrix(0, 4) = "学期"
        .TextMatrix(0, 5) = "本次交费(元)"
        .TextMatrix(0, 6) = "本次欠费(元)"
        .TextMatrix(0, 7) = "累计欠费(元)"
        .TextMatrix(0, 8) = "日期"
        .TextMatrix(0, 9) = "操作员"
        .ColWidth(0) = 200
        .ColWidth(1) = 800
        .ColWidth(2) = 1000
        .ColWidth(3) = 1000
        .ColWidth(4) = 2300
        .ColWidth(5) = 1200
        .ColWidth(6) = 1200
        .ColWidth(7) = 1200
        .ColWidth(8) = 900
        .ColWidth(9) = 900
        .FixedRows = 1
        For i = 1 To 4
            .ColAlignment(i) = 0
        Next i
        For i = 5 To 9
            .ColAlignment(i) = 6 '靠右
        Next i
        .FillStyle = flexFillSingle
        .Col = 0
        .Row = 0
        .RowSel = 1
        .ColSel = .Cols - 1
        .CellAlignment = 4
        .Row = 1
    End With
End Sub
Public Sub xuefeidata()
    jfshowtitle
    max
    Dim mrc As ADODB.Recordset
    Dim mrc2 As ADODB.Recordset
    txtsql = "select jf.学号,xj.姓名,xj.班级,jf.学期,jf.交费,jf.欠费,jf.日期, " & _
        "jf.操作员 from jf inner join xj on jf.学号=xj.学号 where jf.学期='" & _
        maxx & "年度第二学期 ' and xj.班级='" & Trim(classtxt) & _
        "' order by jf.学号,jf.日期"
    Set mrc = ExecuteSQL(txtsql)
    If mrc.EOF = True Then
        txtsql = "select jf.学号,xj.姓名,xj.班级,jf.学期,jf.交费,jf.欠费," & _
            "jf.日期,jf.操作员 from jf inner join xj on jf.学号=xj.学号 " & _
            " where jf.学期='" & maxx & "年度第一学期 ' and xj.班级='" & _
            Trim(classtxt) & "' order by jf.学号,jf.日期"
        Set mrc = ExecuteSQL(txtsql)
        If mrc.EOF = True Then
            MSF1.Clear
            Exit Sub
        Else
            maxx = maxx & "年度第一学期"
        End If
    Else
        maxx = maxx & "年度第二学期"
    End If
    txtsql = "select 学号,sum(欠费) from jf where 学号 in " & _
        "(select 学号 from xj where 班级='" & Trim(classtxt) & "') group by 学号 "
    Set mrc2 = ExecuteSQL(txtsql)
    Dim j As Integer
    Dim i As Integer
    If mrc.EOF = True Then
        MSF1.Clear
        Exit Sub
    End If
    mrc.MoveFirst
    With MSF1
        .Rows = 20
        .Row = 1
        Do Until mrc.EOF
            .Rows = .Rows + 1
            .TextMatrix(.Row, 1) = mrc.Fields(0)
            .TextMatrix(.Row, 2) = mrc.Fields(1)
            .TextMatrix(.Row, 3) = mrc.Fields(2)
            .TextMatrix(.Row, 4) = mrc.Fields(3)
            .TextMatrix(.Row, 5) = "¥" & Format(mrc.Fields(4), "0.00")
            If Val(mrc.Fields(5)) >= 0 Then
                .TextMatrix(.Row, 6) = "¥" & Format(mrc.Fields(5), "0.00")
            Else
                .TextMatrix(.Row, 6) = "-¥" & Format(-Val(mrc.Fields(5)), "0.00")
            End If
            .TextMatrix(.Row, 7) = "¥" & Format(mrc2.Fields(1), "0.00")
            .TextMatrix(.Row, 8) = mrc.Fields(6)
            .TextMatrix(.Row, 9) = mrc.Fields(7)
            .Row = .Row + 1
            mrc.MoveNext
            num = mrc2.Fields(0)
            mrc2.MoveNext
            If mrc.EOF = False Then
                If Trim(num) = Trim(mrc.Fields(0)) Then
                    mrc2.MovePrevious
                End If
            End If
        Loop
    End With
End Sub
Private Sub Form_Activate()
    jftree
End Sub
Private Sub max()
    Dim mrc As ADODB.Recordset
    txtsql = "select max(学期) from jf  where 学号 in " & _
        "(select 学号 from class where 班级='" & Trim(classtxt) & "')"
    Set mrc = ExecuteSQL(txtsql)
    If mrc.EOF = True Then
        Exit Sub
    Else
        If IsNull(mrc.Fields(0)) Then
            Exit Sub
        End If
    End If
    maxx = Left(mrc.Fields(0), 11)
    g = 1
End Sub
Private Sub Form_Load()
    MSF1.Clear
    jfshowtitle
End Sub
Private Sub MSF1_DblClick()
    If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then
        sssss = MsgBox("无当前选择记录!", vbOKOnly + vbExclamation, "警告")
        Exit Sub
    End If
    Frmjf3.Show 1
End Sub
Public Sub jftree()
    TreeView1.Nodes.Clear
    Dim nodex As Node
    Dim mrc As ADODB.Recordset
    Dim mrc1 As ADODB.Recordset
    Dim str As String
    Dim a As String
    a = "年级"
    TreeView1.LineStyle = tvwRootLines
    str = "select distinct 年级 from class order by 年级"
    Set mrc = ExecuteSQL(str)
    str = "select distinct 年级,班级 from class order by 年级,班级"
    Set mrc1 = ExecuteSQL(str)
    mrc.MoveFirst
    Do Until mrc.EOF
        mrc1.MoveFirst
        Set nodex = TreeView1.Nodes.add(, , a, mrc.Fields(0), 1, 1)
        Do While Not mrc1.EOF
            If mrc1.Fields(0) = mrc.Fields(0) Then
                Set nodex = TreeView1.Nodes.add(a, tvwChild, , mrc1.Fields(1), 2, 2)
            End If
            mrc1.MoveNext
        Loop
        a = a & "1"
        mrc.MoveNext
    Loop
    mrc1.Close
    mrc.Close
    Set mrc = Nothing
    Set mrc1 = Nothing
End Sub
Private Sub TreeView1_DblClick()
    On Error GoTo ss
    If TreeView1.SelectedItem.Index = 0 Then
        MSF1.Clear
        Exit Sub
    End If
    classtxt = TreeView1.Nodes.Item(TreeView1.SelectedItem.Index)
    xuefeidata
    Exit Sub
ss:
    MSF1.Clear
End Sub

⌨️ 快捷键说明

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