?? 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 + -