📄 frmtjb.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
Begin VB.Form frmTJHZ
BackColor = &H8000000B&
Caption = "统计汇总"
ClientHeight = 5175
ClientLeft = 480
ClientTop = 1650
ClientWidth = 9120
HelpContextID = 10
Icon = "frmTJb.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5175
ScaleWidth = 9120
WindowState = 2 'Maximized
Begin VB.PictureBox Picture1
Align = 3 'Align Left
Height = 5175
Index = 1
Left = 2895
ScaleHeight = 5115
ScaleWidth = 6165
TabIndex = 5
Top = 0
Width = 6225
Begin MSChart20Lib.MSChart MSChart1
DragMode = 1 'Automatic
Height = 4080
Left = 105
OleObjectBlob = "frmTJb.frx":0442
TabIndex = 6
Top = 690
Visible = 0 'False
Width = 5925
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmTJb.frx":2740
Height = 3315
Left = 0
TabIndex = 7
Top = 0
Width = 7695
_ExtentX = 13573
_ExtentY = 5847
_Version = 393216
AllowUpdate = 0 'False
AllowArrows = 0 'False
BorderStyle = 0
HeadLines = 2
RowHeight = 17
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 1065.26
EndProperty
BeginProperty Column01
ColumnWidth = 1005.165
EndProperty
EndProperty
End
End
Begin VB.PictureBox Picture1
Align = 3 'Align Left
Height = 5175
Index = 0
Left = 0
ScaleHeight = 5115
ScaleWidth = 2835
TabIndex = 0
Top = 0
Width = 2895
Begin VB.Frame Frame1
Caption = "时间段:"
Height = 1215
Left = 240
TabIndex = 8
Top = 120
Width = 2415
Begin MSComCtl2.DTPicker dtpTjRq
Height = 300
Index = 0
Left = 600
TabIndex = 9
Top = 360
Width = 1575
_ExtentX = 2778
_ExtentY = 529
_Version = 393216
Format = 24444929
CurrentDate = 36526
End
Begin MSComCtl2.DTPicker dtpTjRq
Height = 300
Index = 1
Left = 600
TabIndex = 10
Top = 720
Width = 1575
_ExtentX = 2778
_ExtentY = 529
_Version = 393216
Format = 24444929
CurrentDate = 36526
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "从:"
Height = 180
Index = 5
Left = 240
TabIndex = 12
Top = 360
Width = 270
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "到:"
Height = 180
Left = 240
TabIndex = 11
Top = 720
Width = 270
End
End
Begin VB.OptionButton optHzt
Caption = "统计汇总图"
Height = 300
Left = 240
Style = 1 'Graphical
TabIndex = 4
Top = 2760
Width = 2295
End
Begin VB.OptionButton optHzb
Caption = "统计汇总表"
Height = 300
Left = 240
Style = 1 'Graphical
TabIndex = 3
Top = 2400
Value = -1 'True
Width = 2295
End
Begin VB.ComboBox cboLB
Height = 300
ItemData = "frmTJb.frx":2755
Left = 240
List = "frmTJb.frx":275F
Style = 2 'Dropdown List
TabIndex = 2
Top = 1800
Width = 2295
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "类别:"
Height = 180
Left = 240
TabIndex = 1
Top = 1560
Width = 450
End
End
End
Attribute VB_Name = "frmTJHZ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As ADODB.Recordset
Private Sub dtpTjRq_Change(Index As Integer)
HZJS '调用过程汇总
End Sub
Private Sub cboLB_Click()
HZJS '调用过程汇总
End Sub
Private Sub Form_Activate()
fMain.RsPC Caption
End Sub
Private Sub Form_Load()
'初始汇总时间段
dtpTjRq(0) = DateAdd("m", -1, Date)
dtpTjRq(1) = Date
Set rs = New ADODB.Recordset
cboLB.ListIndex = 0
End Sub
Private Sub Form_Resize()
ReFrom
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
rs.Close
Set rs = Nothing
Set frmTJHZ = Nothing
End Sub
Private Sub HZ_TJTU()
'该过程用于产生汇总图
On Error Resume Next
Dim varRecords()
Dim Rows As Integer
Dim Cols As Integer
Dim Col As Integer
Dim Row As Integer
Dim rsTp As ADODB.Recordset
Set rsTp = rs.Clone
'确定动态数组大小
Cols = rsTp.Fields.Count - 1
Rows = rsTp.RecordCount
If Rows = 0 Then
Me.MSChart1.ColumnCount = 0
Me.MSChart1.RowCount = 0
Exit Sub
End If
ReDim varRecords(0 To Cols, 0 To Rows)
'将记录集中的数据转到动态数组
For Col = 0 To Cols
varRecords(Col, 0) = rsTp(Col).Name
Next Col
rsTp.MoveFirst
Row = 1
Do Until rsTp.EOF
For Col = 0 To Cols
varRecords(Col, Row) = rsTp(Col)
Next Col
Row = Row + 1
rsTp.MoveNext
Loop
rsTp.Close
Me.MSChart1.ChartData = varRecords '将数组中数据传入汇总图
End Sub
Private Sub HZJS()
On Error Resume Next
'控制汇总流程
If rs.State = 1 Then
rs.Close
End If
If cboLB.ListIndex = 0 Then
DbeJcgl.SRHZ dtpTjRq(0), dtpTjRq(1), gstrName
Set rs = DbeJcgl.rsSRHZ '收入汇总
Else
DbeJcgl.ZCHZ dtpTjRq(0), dtpTjRq(1), gstrName
Set rs = DbeJcgl.rsZCHZ '支出汇总
End If
Set DataGrid1.DataSource = rs
HZ_TJTU '调子过程绘出汇总图
End Sub
Private Sub optHzb_Click()
'转汇总表
MSChart1.Visible = False
DataGrid1.Visible = True
End Sub
Private Sub optHzt_Click()
'转汇总图
DataGrid1.Visible = False
MSChart1.Visible = True
End Sub
Public Sub ReFrom()
'调整控件位置、大小
On Error Resume Next
If Width < 6000 Then
Width = 6000
End If
If Height < 6000 Then
Height = 6000
End If
Picture1(1).Move 2895, 0, Width - 3020, Height - 400
DataGrid1.Move 0, 0, Picture1(1).Width - 60, Picture1(1).Height - 60
MSChart1.Move 0, 0, Picture1(1).Width - 60, Picture1(1).Height - 60
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -