?? frmtj.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form8
Caption = "Form8"
ClientHeight = 3645
ClientLeft = 60
ClientTop = 465
ClientWidth = 5355
LinkTopic = "Form8"
ScaleHeight = 3645
ScaleWidth = 5355
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 4080
TabIndex = 10
Top = 240
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Frmtj.frx":0000
Left = 1560
List = "Frmtj.frx":0002
TabIndex = 9
Top = 240
Width = 735
End
Begin VB.CommandButton Command1
Caption = "統計"
Height = 375
Left = 2880
TabIndex = 8
Top = 240
Width = 1215
End
Begin VB.TextBox Text4
Height = 495
Left = 1920
TabIndex = 7
Top = 2520
Width = 2655
End
Begin VB.Frame Frame1
Caption = "統計結果"
Height = 2655
Left = 360
TabIndex = 1
Top = 840
Width = 4455
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 2040
Top = 2280
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=grcw1.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=grcw1.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "zcb"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 240
Top = 2280
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=grcw1.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=grcw1.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "slb"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text3
Height = 495
Left = 1560
TabIndex = 5
Top = 960
Width = 2655
End
Begin VB.TextBox Text2
Height = 495
Left = 1560
TabIndex = 3
Top = 240
Width = 2655
End
Begin VB.Label Label4
Caption = "收支情況:"
Height = 495
Left = 360
TabIndex = 6
Top = 1800
Width = 1095
End
Begin VB.Label Label3
Caption = "支出情況:"
Height = 375
Left = 360
TabIndex = 4
Top = 1080
Width = 1335
End
Begin VB.Label Label2
Caption = "收入情況:"
Height = 495
Left = 360
TabIndex = 2
Top = 360
Width = 1455
End
End
Begin VB.Label Label5
Caption = "月"
Height = 255
Left = 2400
TabIndex = 11
Top = 360
Width = 375
End
Begin VB.Label Label1
Caption = "所要統計月份:"
Height = 375
Left = 120
TabIndex = 0
Top = 360
Width = 1335
End
End
Attribute VB_Name = "Form8"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim i, j As Integer
Dim k, q As Long
k = 0
q = 0
Dim yuefen As String
yuefen = Combo1.Text
Adodc1.CommandType = adCmdText
Adodc2.CommandType = adCmdText
Adodc1.RecordSource = "select * from slb where month(收入日期)=" & yuefen & ""
Adodc2.RecordSource = "select * from zcb where month(支出日期)=" & yuefen & ""
Adodc1.Refresh
Adodc2.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "不存在月份為" & yuefen & "的收入"
Else
Adodc1.Recordset.MoveFirst
For j = 1 To Adodc1.Recordset.RecordCount
k = k + Adodc1.Recordset.Fields(3)
Adodc1.Recordset.MoveNext
Next j
Text2.Text = k
End If
If Adodc2.Recordset.RecordCount = 0 Then
MsgBox "不存在月份為" & yuefen & "的支出"
Else
Adodc2.Recordset.MoveFirst
For i = 1 To Adodc2.Recordset.RecordCount
q = q + Adodc2.Recordset.Fields(3)
Adodc2.Recordset.MoveNext
Next i
Text3.Text = q
End If
Text4.Text = k - q
End Sub
Private Sub Command2_Click()
Unload Form8
End Sub
Private Sub Form_Load()
Combo1.AddItem "1"
Combo1.AddItem "2"
Combo1.AddItem "3"
Combo1.AddItem "4"
Combo1.AddItem "5"
Combo1.AddItem "6"
Combo1.AddItem "7"
Combo1.AddItem "8"
Combo1.AddItem "9"
Combo1.AddItem "10"
Combo1.AddItem "11"
Combo1.AddItem "12"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -