frm_rate.frm
资源名称:jtlc.rar [点击查看]
上传用户:xxdyjx888
上传日期:2022-06-01
资源大小:55k
文件大小:12k
源码类别:
家庭/个人应用
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
- Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
- Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
- Begin VB.Form frm_rate
- Caption = "饼图"
- ClientHeight = 5265
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6945
- Icon = "frm_rate.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 5265
- ScaleWidth = 6945
- StartUpPosition = 2 'CenterScreen
- Begin TabDlg.SSTab SSTab1
- Height = 4935
- Left = 0
- TabIndex = 0
- Top = 360
- Width = 6975
- _ExtentX = 12303
- _ExtentY = 8705
- _Version = 393216
- Tabs = 2
- TabHeight = 520
- TabCaption(0) = "收入情况"
- TabPicture(0) = "frm_rate.frx":030A
- Tab(0).ControlEnabled= -1 'True
- Tab(0).Control(0)= "Label4"
- Tab(0).Control(0).Enabled= 0 'False
- Tab(0).Control(1)= "Label5"
- Tab(0).Control(1).Enabled= 0 'False
- Tab(0).Control(2)= "Label6"
- Tab(0).Control(2).Enabled= 0 'False
- Tab(0).Control(3)= "MSChart1"
- Tab(0).Control(3).Enabled= 0 'False
- Tab(0).Control(4)= "Command3"
- Tab(0).Control(4).Enabled= 0 'False
- Tab(0).Control(5)= "Command4"
- Tab(0).Control(5).Enabled= 0 'False
- Tab(0).Control(6)= "MSHFlexGrid1"
- Tab(0).Control(6).Enabled= 0 'False
- Tab(0).Control(7)= "Command5"
- Tab(0).Control(7).Enabled= 0 'False
- Tab(0).ControlCount= 8
- TabCaption(1) = "支出情况"
- TabPicture(1) = "frm_rate.frx":0326
- Tab(1).ControlEnabled= 0 'False
- Tab(1).Control(0)= "Label2"
- Tab(1).Control(1)= "Label3"
- Tab(1).Control(2)= "Label7"
- Tab(1).Control(3)= "MSChart2"
- Tab(1).Control(4)= "Command1"
- Tab(1).Control(5)= "Command2"
- Tab(1).Control(6)= "MSHFlexGrid2"
- Tab(1).Control(7)= "Command6"
- Tab(1).ControlCount= 8
- Begin VB.CommandButton Command6
- Caption = "关闭"
- Height = 375
- Left = -69240
- TabIndex = 15
- Top = 4320
- Width = 1095
- End
- Begin VB.CommandButton Command5
- Caption = "关闭"
- Height = 375
- Left = 5760
- TabIndex = 14
- Top = 4320
- Width = 1095
- End
- Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid2
- Height = 3255
- Left = -71400
- TabIndex = 11
- Top = 360
- Width = 3255
- _ExtentX = 5741
- _ExtentY = 5741
- _Version = 393216
- Cols = 1
- FixedCols = 0
- AllowUserResizing= 1
- _NumberOfBands = 1
- _Band(0).Cols = 1
- End
- Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1
- Height = 3255
- Left = 3600
- TabIndex = 10
- Top = 360
- Width = 3255
- _ExtentX = 5741
- _ExtentY = 5741
- _Version = 393216
- Cols = 1
- FixedCols = 0
- AllowUserResizing= 1
- _NumberOfBands = 1
- _Band(0).Cols = 1
- End
- Begin VB.CommandButton Command4
- Caption = "按项目统计"
- Height = 375
- Left = 4680
- TabIndex = 7
- Top = 4320
- Width = 1095
- End
- Begin VB.CommandButton Command3
- Caption = "按人员统计"
- Height = 375
- Left = 3600
- TabIndex = 6
- Top = 4320
- Width = 1095
- End
- Begin VB.CommandButton Command2
- Caption = "按项目统计"
- Height = 375
- Left = -70320
- TabIndex = 3
- Top = 4320
- Width = 1095
- End
- Begin VB.CommandButton Command1
- Caption = "按人员统计"
- Height = 375
- Left = -71400
- TabIndex = 2
- Top = 4320
- Width = 1095
- End
- Begin MSChart20Lib.MSChart MSChart2
- Height = 4335
- Left = -74760
- OleObjectBlob = "frm_rate.frx":0342
- TabIndex = 16
- Top = 480
- Width = 3135
- End
- Begin MSChart20Lib.MSChart MSChart1
- Height = 4335
- Left = 240
- OleObjectBlob = "frm_rate.frx":1C10
- TabIndex = 17
- Top = 480
- Width = 3135
- End
- Begin VB.Label Label7
- Caption = "Label7"
- Height = 255
- Left = -70440
- TabIndex = 13
- Top = 3840
- Width = 1335
- End
- Begin VB.Label Label6
- Caption = "Label6"
- Height = 255
- Left = 4560
- TabIndex = 12
- Top = 3840
- Width = 1335
- End
- Begin VB.Label Label5
- AutoSize = -1 'True
- Height = 180
- Left = 4680
- TabIndex = 9
- Top = 3840
- Width = 90
- End
- Begin VB.Label Label4
- Caption = "总计:"
- Height = 375
- Left = 3960
- TabIndex = 8
- Top = 3840
- Width = 615
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Height = 180
- Left = -70320
- TabIndex = 5
- Top = 3840
- Width = 90
- End
- Begin VB.Label Label2
- Caption = "总计:"
- Height = 255
- Left = -71040
- TabIndex = 4
- Top = 3840
- Width = 615
- End
- End
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "Label1"
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 1
- Top = 120
- Width = 4575
- End
- End
- Attribute VB_Name = "frm_rate"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim Mydb As New ADODB.Recordset
- Dim Mydb1 As New ADODB.Recordset
- Dim Mydb3 As New ADODB.Recordset
- Dim Mydb4 As New ADODB.Recordset
- Dim Str_text As String
- Private Sub Command1_Click()
- Dim A, B As Integer
- Set Mydb4 = ExeCutesql("select sum(金额) from 支出", "")
- A = Mydb4.Fields(0)
- Set Mydb3 = ExeCutesql("select 人员,sum(金额) as 金额,str(cint(sum(金额)/'" & A & "'*100)) & '%' as 百分比 from 支出 group by 人员 ", Str_text)
- Mydb3.Requery
- Set MSHFlexGrid2.DataSource = Mydb3
- Command2.Enabled = True
- Command1.Enabled = False
- B = Mydb3.RecordCount
- MSChart2.ColumnCount = B
- MSChart2.ColumnLabel = Mydb3.Fields(0)
- End Sub
- Private Sub Command2_Click()
- Dim B, C As Integer
- Set Mydb4 = ExeCutesql("select sum(金额) from 支出", "")
- B = Mydb4.Fields(0)
- Set Mydb3 = ExeCutesql("select 项目,sum(金额) as 金额,str(cint(sum(金额)/'" & B & "'*100)) & '%' as 百分比 from 支出 group by 项目 ", Str_text)
- Set MSHFlexGrid2.DataSource = Mydb3
- Command2.Enabled = False
- Command1.Enabled = True
- C = Mydb3.RecordCount
- MSChart2.ColumnCount = C
- MSChart2.ColumnLabel = Mydb3.Fields(0)
- End Sub
- Private Sub Command3_Click()
- Dim A, B As Integer
- Set Mydb1 = ExeCutesql("select sum(金额) from 收入", "")
- A = Mydb1.Fields(0)
- Set Mydb = ExeCutesql("select 人员,sum(金额) as 金额,str(cint(sum(金额)/'" & A & "'*100)) & '%' as 百分比 from 收入 group by 人员 ", Str_text)
- Mydb.Requery
- Set MSHFlexGrid1.DataSource = Mydb
- Command3.Enabled = False
- Command4.Enabled = True
- B = Mydb.RecordCount
- MSChart1.ColumnCount = B
- MSChart1.ColumnLabel = Mydb.Fields(0)
- End Sub
- Private Sub Command4_Click()
- Dim A, C As Integer
- Set Mydb1 = ExeCutesql("select sum(金额) from 收入", "")
- A = Mydb1.Fields(0)
- Set Mydb = ExeCutesql("select 项目,sum(金额) as 金额,str(cint(sum(金额)/'" & A & "'*100)) & '%' as 百分比 from 收入 group by 项目 ", Str_text)
- Set MSHFlexGrid1.DataSource = Mydb
- Command4.Enabled = False
- Command3.Enabled = True
- C = Mydb.RecordCount
- MSChart1.ColumnCount = C
- MSChart1.ColumnLabel = Mydb.Fields(0)
- End Sub
- Private Sub Command5_Click()
- Unload Me
- End Sub
- Private Sub Command6_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- Dim A, B, C, D As Integer
- Command4.Enabled = False
- Command2.Enabled = False
- Set Mydb1 = ExeCutesql("select sum(金额) from 收入", "")
- A = Mydb1.Fields(0)
- Set Mydb = ExeCutesql("select 项目,sum(金额) as 金额,str(cint(sum(金额)/'" & A & "'*100)) & '%' as 百分比 from 收入 group by 项目 ", Str_text)
- Set MSHFlexGrid1.DataSource = Mydb
- Set Mydb4 = ExeCutesql("select sum(金额) from 支出", "")
- B = Mydb4.Fields(0)
- Set Mydb3 = ExeCutesql("select 项目,sum(金额) as 金额,str(cint(sum(金额)/'" & B & "'*100)) & '%' as 百分比 from 支出 group by 项目 ", Str_text)
- Set MSHFlexGrid2.DataSource = Mydb3
- Label1.Caption = Year(Now) & "年" & Month(Now) & "月" & ":"
- Label6.Caption = A & "元"
- Label7.Caption = B & "元"
- MSChart1.RowCount = 1
- MSChart2.RowCount = 1
- MSChart1.RowLabel = "收入情况"
- MSChart2.RowLabel = "支出情况"
- C = Mydb.RecordCount
- D = Mydb3.RecordCount
- If C > 0 Then
- MSChart1.ColumnCount = C
- MSChart1.ColumnLabel = Mydb.Fields(0)
- End If
- If D > 0 Then
- MSChart2.ColumnCount = D
- MSChart2.ColumnLabel = Mydb3.Fields(0)
- End If
- End Sub