📄 frmtj.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmTJ
Caption = "月总各项统计"
ClientHeight = 3525
ClientLeft = 3810
ClientTop = 3615
ClientWidth = 7455
LinkTopic = "Form3"
ScaleHeight = 3525
ScaleWidth = 7455
Begin VB.CommandButton Command1
Caption = "返回"
Height = 495
Left = 5520
TabIndex = 3
Top = 240
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Left = 2760
TabIndex = 1
Top = 360
Width = 1935
End
Begin VB.Data Data2
Caption = "Data2"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\YWB\桌面\水电费管理系统\水电费管理系统数据库.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 5520
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "月份表"
Top = 3120
Visible = 0 'False
Width = 1140
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\YWB\桌面\水电费管理系统\水电费管理系统数据库.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 720
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "水电费表"
Top = 3120
Visible = 0 'False
Width = 1140
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Bindings = "frmTJ.frx":0000
Height = 2295
Left = 240
TabIndex = 0
Top = 840
Width = 6975
_ExtentX = 12303
_ExtentY = 4048
_Version = 393216
AllowUserResizing= 3
End
Begin VB.Label Label1
Caption = "选择月份"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 2
Top = 360
Width = 975
End
End
Attribute VB_Name = "frmTJ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
If Trim(Combo1) <> "全部月份" Then
Data2.Recordset.MoveFirst
Data2.Recordset.FindFirst "month like " & "'" & Trim(Combo1) & "'"
Data1.RecordSource = "select count(*) as 用户数,sum(water) as 总用水量,sum(electric) as 总用电量,sum(water_cost) as 总应收水费,sum(electric_cost) as 总应收电费 from 水电费表 where month = '" & Data2.Recordset.Month & " '"
Data1.Refresh
Else
Data1.RecordSource = "select count(*) as 用户数,sum(water) as 总用水量,sum(electric) as 总用电量,sum(water_cost) as 总应收水费,sum(electric_cost) as 总应收电费 from 水电费表"
Data1.Refresh
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Combo1.Clear
Combo1.AddItem "全部月份"
Combo1.Text = "全部月份"
Data2.Recordset.MoveFirst
Do While Not Data2.Recordset.EOF
Combo1.AddItem Data2.Recordset.Month
Data2.Recordset.MoveNext
Loop
Data1.RecordSource = "select count(*) as 用户数,sum(water) as 总用水量,sum(electric) as 总用电量,sum(water_cost) as 总应收水费,sum(electric_cost) as 总应收电费 from 水电费表"
Data1.Refresh
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path + "\水电费管理系统数据库.mdb"
Data1.RecordSource = "水电费表"
Data2.DatabaseName = App.Path + "\水电费管理系统数据库.mdb"
Data2.RecordSource = "月份表"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -