?? form2.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 = 16777215
BackColorFixed = 12632256
ForeColorFixed = 0
BackColorSel = 16777215
ForeColorSel = 0
BackColorBkg = 16777215
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 = &H00000000&
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 學期<>'" & maxx & "' and 學號 in (select 學號 from jf where 學期='" & maxx & "') and 學號 in (select 學號 from xj where 班級='" & Trim(classtxt) & "') group by 學號 "
'Set mrc1 = ExecuteSQL(txtsql)
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
'.MergeCells = flexMergeFree
' .MergeRow(0) = True
' .MergeCol(7) = True
.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 Command1_Click()
End Sub
Private Sub Form_Activate()
'jfshowtitle
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 + -