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

📄 frmjf3.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 Frmjf3 
   Appearance      =   0  'Flat
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "学生详细交费情况"
   ClientHeight    =   5010
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9240
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5010
   ScaleWidth      =   9240
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Frame2 
      Height          =   975
      Left            =   6720
      TabIndex        =   7
      Top             =   -15
      Width           =   2415
      Begin MSComctlLib.Toolbar Toolbar1 
         Height          =   765
         Left            =   120
         TabIndex        =   8
         Top             =   120
         Width           =   2190
         _ExtentX        =   3863
         _ExtentY        =   1349
         ButtonWidth     =   1032
         ButtonHeight    =   1349
         Style           =   1
         ImageList       =   "ImageList1"
         _Version        =   393216
         BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
            NumButtons      =   5
            BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Caption         =   "查找"
               ImageKey        =   "find"
            EndProperty
            BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Style           =   3
            EndProperty
            BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Caption         =   "删除"
               ImageKey        =   "del"
            EndProperty
            BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Style           =   3
            EndProperty
            BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Caption         =   "打印"
               ImageKey        =   "print"
               Style           =   5
               BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628} 
                  NumButtonMenus  =   2
                  BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628} 
                     Key             =   "dang"
                     Text            =   "打印当前记录"
                  EndProperty
                  BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628} 
                     Key             =   "all"
                     Text            =   "打印全部记录"
                  EndProperty
               EndProperty
            EndProperty
         EndProperty
      End
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   1080
      Top             =   2400
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   3
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Frmjf3.frx":0000
            Key             =   "del"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Frmjf3.frx":0458
            Key             =   "print"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Frmjf3.frx":0AD4
            Key             =   "find"
         EndProperty
      EndProperty
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   270
      Index           =   2
      Left            =   3240
      Locked          =   -1  'True
      TabIndex        =   6
      TabStop         =   0   'False
      Top             =   435
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   270
      Index           =   1
      Left            =   5520
      Locked          =   -1  'True
      TabIndex        =   5
      TabStop         =   0   'False
      Top             =   435
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000018&
      ForeColor       =   &H000000FF&
      Height          =   270
      Index           =   0
      Left            =   3240
      Locked          =   -1  'True
      TabIndex        =   4
      TabStop         =   0   'False
      Top             =   75
      Width           =   855
   End
   Begin VB.Frame Frame1 
      Caption         =   "详细交费情况"
      Height          =   4095
      Left            =   120
      TabIndex        =   0
      Top             =   840
      Width           =   9015
      Begin VB.TextBox Text2 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Height          =   495
         Left            =   2760
         TabIndex        =   10
         Text            =   "Text2"
         Top             =   1320
         Visible         =   0   'False
         Width           =   1935
      End
      Begin MSFlexGridLib.MSFlexGrid MSF1 
         Height          =   3735
         Left            =   120
         TabIndex        =   9
         Top             =   240
         Width           =   8775
         _ExtentX        =   15478
         _ExtentY        =   6588
         _Version        =   393216
         BackColor       =   -2147483624
         BackColorBkg    =   -2147483624
         AllowUserResizing=   1
      End
   End
   Begin VB.Label Label3 
      Caption         =   "班级:"
      Height          =   255
      Left            =   4800
      TabIndex        =   3
      Top             =   480
      Width           =   615
   End
   Begin VB.Label Label2 
      Caption         =   "学号:"
      Height          =   255
      Left            =   2400
      TabIndex        =   2
      Top             =   105
      Width           =   615
   End
   Begin VB.Label Label7 
      Caption         =   "姓名:"
      Height          =   255
      Left            =   2400
      TabIndex        =   1
      Top             =   480
      Width           =   615
   End
End
Attribute VB_Name = "Frmjf3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Public Sub xxjfshowtitle()
MSF1.Clear
  Dim i As Integer
  With MSF1
    .Cols = 6
   
    .TextMatrix(0, 1) = "学期"
    .TextMatrix(0, 2) = "本次交费(元)"
    .TextMatrix(0, 3) = "本次欠费(元)"
    .TextMatrix(0, 4) = "日期"
    .TextMatrix(0, 5) = "操作员"
  
    .ColWidth(0) = 200
    .ColWidth(1) = 2200
    .ColWidth(2) = 1500
    .ColWidth(3) = 1500
    .ColWidth(4) = 1500
    .ColWidth(5) = 1200
 
    .FixedRows = 1
    For i = 1 To 5
      .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 xxxuefeidata()
Dim mrc As ADODB.Recordset
Dim mrc1 As ADODB.Recordset
txtsql = "select jf.学号,xj.姓名,xj.班级,jf.学期,jf.交费,jf.欠费,jf.日期,jf.操作员 from jf inner join xj on jf.学号=xj.学号 where jf.学号='" & Trim(frmjf2.MSF1.TextMatrix(frmjf2.MSF1.Row, 1)) & "' order by jf.日期"
Set mrc = ExecuteSQL(txtsql)
txtsql = "select 学号,sum(交费),sum(欠费) from jf where 学号='" & Trim(frmjf2.MSF1.TextMatrix(frmjf2.MSF1.Row, 1)) & "' group by 学号 order by 学号"
Set mrc1 = 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 = 3
    .Row = 1
 Do While Not mrc.EOF
   .Rows = .Rows + 1
   For i = 0 To 2
  Text1(i) = mrc.Fields(i)
Next i
    .TextMatrix(.Row, 1) = mrc.Fields(3)
   .TextMatrix(.Row, 2) = "¥" & Format(mrc.Fields(4), "0.00")
   If Val(mrc.Fields(5)) >= 0 Then
    .TextMatrix(.Row, 3) = "¥" & Format(mrc.Fields(5), "0.00")
   Else
      .TextMatrix(.Row, 3) = "-¥" & Format(-Val(mrc.Fields(5)), "0.00")
   End If
       .TextMatrix(.Row, 4) = mrc.Fields(6)
        .TextMatrix(.Row, 5) = mrc.Fields(7)
     
   .Row = .Row + 1
        mrc.MoveNext
 Loop
' .MergeCells = flexMergeFree
 
' .MergeRow(6) = True
  '.MergeCol(1) = True
'.MergeCol(2) = True
' .MergeCol(3) = True
' .MergeCol(4) = True
  .Row = .Row + 1
  .Col = 1
   MSF1.CellForeColor = vbRed
   .TextMatrix(.Row, 1) = "累计交费:"
   .Col = 2
     MSF1.CellForeColor = vbRed
     .TextMatrix(.Row, 2) = "¥" & Format(mrc1.Fields(1), "0.00") & " 元"
     .Col = 4
      MSF1.CellForeColor = vbRed
      .TextMatrix(.Row, 4) = "累计欠费:"
       .Col = 5
     MSF1.CellForeColor = vbRed
      .TextMatrix(.Row, 5) = "¥" & Format(mrc1.Fields(2), "0.00") & " 元"
      
 End With
   
End Sub

Private Sub Form_Activate()
xxjfshowtitle
xxxuefeidata
End Sub

Private Sub MSF1_Click()
Text2.Visible = False
MSF1.SetFocus
End Sub

Private Sub MSF1_DblClick()
With MSF1
Dim c As Integer
Dim r As Integer
r = .Row
c = .Col
If c = 1 Or r = .Rows - 1 Or r = .Rows - 2 Then
Dim ss As String
ss = MsgBox("该项不能修改!", vbExclamation + vbOKOnly, " 警告")
Exit Sub
End If
qxstr = Executeqx(3)
  If qxstr = "readonly" Then
  ss = MsgBox("对不起,你是只读用户不能修改记录,请与管理员联系!", vbInformation + vbOKOnly, " 警告")
  Exit Sub
   End If
Text2.Top = .Top + .RowPos(r) + 15
Text2.Left = .Left + .ColPos(c) + 25
Text2.Width = .ColWidth(c)
Text2.Height = .RowHeight(r) - 15
Text2.Text = .Text
    Text2.SelStart = 0
   Text2.SelLength = Len(Text2.Text)
Text2.Visible = True
Text2.SetFocus

End With
End Sub



Private Sub Text2_KeyPress(KeyAscii As Integer)
Dim shao As Integer
Dim zs As String
If KeyAscii <> 8 And KeyAscii <> 13 Then
shao = InStr(Trim(Text1(Index).Text), ".")
If shao <> 0 Then
zs = Right(Trim(Text1(Index).Text), Len(Trim(Text1(Index).Text)) - shao)
If Len(zs) > 1 Then KeyAscii = 0
End If
End If
Select Case MSF1.Col
        Case 2
         If KeyAscii = 13 Or KeyAscii = 46 Or KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 8 Then
           Else
           KeyAscii = 0
          Exit Sub
         End If
         Case 3
          If KeyAscii = 13 Or KeyAscii = 46 Or KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 8 Then
            Else
            KeyAscii = 0
              Exit Sub
            End If
         Case 4
           If KeyAscii = 13 Or KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 8 Or KeyAscii = 47 Or KeyAscii = 45 Then
                Else
              KeyAscii = 0
                Exit Sub
                End If
        End Select
If KeyAscii = 13 Then
Dim str As String
Dim mrc As ADODB.Recordset
Select Case MSF1.Col
        Case 2
        If InStr(Text2.Text, "¥") Then
        str = "update jf set 交费=" & Right(Trim(Text2.Text), Len(Trim(Text2.Text)) - 1) & " where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
        Else
        str = "update jf set 交费=" & Text2.Text & " where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
        End If
         Set mrc = ExecuteSQL(str)
         Case 3
         If InStr(Text2.Text, "¥") Then
         str = "update jf set 欠费=" & Right(Trim(Text2.Text), Len(Trim(Text2.Text)) - 1) & " where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
         Else
         str = "update jf set 欠费=" & Text2.Text & " where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
         End If
        Set mrc = ExecuteSQL(str)
        Case 4
           If Not IsDate(Text2.Text) Then '判断是否日期格式
     ss = MsgBox("应输入日期 mm-dd-yy", vbInformation + vbOKOnly, "警告")
      Text2.SetFocus
      Text2.SelStart = 0
      Text2.SelLength = Len(Text2.Text)
       Exit Sub
      End If
       str = "update jf set  日期=#" & Trim(Text2.Text) & "# where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
        Set mrc = ExecuteSQL(str)
     Case 5
      str = "update jf set  操作员='" & Trim(Text2.Text) & "' where 学号='" & Trim(Text1(0).Text) & "' and 学期='" & Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) & "'"
      Set mrc = ExecuteSQL(str)
End Select
Text2.Visible = False
xxxuefeidata
End If

End Sub

⌨️ 快捷键说明

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