?? frm_list.frm
字號:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form frm_list
Caption = "每月明細"
ClientHeight = 6765
ClientLeft = 60
ClientTop = 345
ClientWidth = 9375
Icon = "frm_list.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 6765
ScaleWidth = 9375
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Caption = "關閉"
Height = 375
Left = 8280
TabIndex = 12
Top = 6120
Width = 975
End
Begin VB.CommandButton Command2
Caption = "其他月份"
Height = 375
Left = 7320
TabIndex = 11
Top = 6120
Width = 975
End
Begin VB.CommandButton Command1
Caption = "餅圖"
Height = 375
Left = 6360
TabIndex = 10
Top = 6120
Width = 975
End
Begin TabDlg.SSTab SSTab1
Height = 5775
Left = 0
TabIndex = 0
Top = 0
Width = 9405
_ExtentX = 16589
_ExtentY = 10186
_Version = 393216
Tabs = 2
TabHeight = 520
ForeColor = -2147483648
TabCaption(0) = "本月收入情況"
TabPicture(0) = "frm_list.frx":030A
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "Label1"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "Label2"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "Label7"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "MSHFlexGrid1"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).ControlCount= 4
TabCaption(1) = "本月支出情況"
TabPicture(1) = "frm_list.frx":0326
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "Label6"
Tab(1).Control(1)= "Label8"
Tab(1).Control(2)= "Label9"
Tab(1).Control(3)= "MSHFlexGrid2"
Tab(1).ControlCount= 4
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid2
Height = 5055
Left = -75000
TabIndex = 9
Top = 720
Width = 9375
_ExtentX = 16536
_ExtentY = 8916
_Version = 393216
AllowUserResizing= 1
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1
Height = 5055
Left = 0
TabIndex = 8
Top = 720
Width = 9375
_ExtentX = 16536
_ExtentY = 8916
_Version = 393216
AllowUserResizing= 1
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin VB.Label Label9
Caption = "元"
Height = 255
Left = -72120
TabIndex = 6
Top = 480
Width = 495
End
Begin VB.Label Label8
ForeColor = &H000000FF&
Height = 255
Left = -73200
TabIndex = 5
Top = 480
Width = 1095
End
Begin VB.Label Label6
Caption = "本月支出:"
Height = 255
Left = -74160
TabIndex = 4
Top = 480
Width = 975
End
Begin VB.Label Label7
Caption = "元"
Height = 255
Left = 2880
TabIndex = 3
Top = 480
Width = 495
End
Begin VB.Label Label2
ForeColor = &H00FF0000&
Height = 255
Left = 1800
TabIndex = 2
Top = 480
Width = 1095
End
Begin VB.Label Label1
Caption = "本月收入:"
Height = 255
Left = 840
TabIndex = 1
Top = 480
Width = 975
End
End
Begin VB.Label Label13
AutoSize = -1 'True
BeginProperty Font
Name = "宋體"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 435
Left = 120
TabIndex = 7
Top = 6000
Width = 225
End
End
Attribute VB_Name = "frm_list"
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 Money As New ADODB.Recordset
Dim Money1 As New ADODB.Recordset
Dim Str_text As String
Private Sub Command1_Click()
frm_rate.Show
End Sub
Private Sub Command2_Click()
frm_date.Show
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Activate()
On Error Resume Next
Dim A, B, C As Integer
Dim D As String
Dim Year1, Month1, Riqi, Riqi1, Riqi3, Riqi4
If AA = True Then
Set Mydb = ExeCutesql("select * from 收入 where 日期 between '" & Cdate1 & "' and '" & Cdate2 & "' ", "")
Set MSHFlexGrid1.DataSource = Mydb
Set Mydb1 = ExeCutesql("select * from 支出 where 日期 between '" & Cdate1 & "' and '" & Cdate2 & "' ", "")
Set MSHFlexGrid2.DataSource = Mydb1
Set Money = ExeCutesql("select sum(金額) from 收入 where 日期 between '" & Cdate1 & "'and '" & Cdate2 & "'", "")
A = Money.Fields(0)
If IsNull(A) Then
A = 0
End If
Label2.Caption = A
Set Money1 = ExeCutesql("select sum(金額) from 支出 where 日期 between '" & Cdate1 & "'and '" & Cdate2 & "'", "")
B = Money1.Fields(0)
If IsNull(B) Then
B = 0
End If
Label8.Caption = B
C = A - B
If C > 0 Then
D = "富裕"
Else
D = "超支"
End If
Label13.Caption = Format(Cdate1, "yyyy年mm月") & "," & "本月你" & D & C & "元!"
Else
Year1 = Year(Now)
Month1 = Month(Now)
Riqi = Year1 & "-" & Month1
Riqi1 = Year1 & "-" & Month1 + 1
Set Mydb = ExeCutesql("select * from 收入 where 日期 between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", Str_text)
Set MSHFlexGrid1.DataSource = Mydb
Set MSHFlexGrid2.DataSource = Mydb1
Set Money = ExeCutesql("select sum(金額) from 收入 where 日期 between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", "")
A = Money.Fields(0)
If IsNull(A) Then
A = 0
End If
Label2.Caption = A
Set Money1 = ExeCutesql("select sum(金額) from 支出 where 日期 between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", "")
B = Money1.Fields(0)
If IsNull(B) Then
B = 0
End If
Label8.Caption = B
C = A - B
If C > 0 Then
D = "富裕"
Else
D = "超支"
End If
Label13.Caption = Year(Now) & "年" & Month(Now) & "月" & "," & "本月你" & D & C & "元!"
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim A, B, C As Integer
Dim D As String
Dim Year1, Month1, Riqi, Riqi1, Riqi3, Riqi4
Year1 = Year(Now)
Month1 = Month(Now)
Riqi = Year1 & "-" & Month1
Riqi1 = Year1 & "-" & Month1 + 1
Set Mydb = ExeCutesql("select * from 收入 where 日期 between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", Str_text)
Set MSHFlexGrid1.DataSource = Mydb
Set Mydb1 = ExeCutesql("select * from 支出 where 日期 between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", Str_text)
Set MSHFlexGrid2.DataSource = Mydb1
Set Money = ExeCutesql("select sum(金額) from 收入 where 日期 between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", "")
A = Money.Fields(0)
If IsNull(A) Then
A = 0
End If
Label2.Caption = A
Set Money1 = ExeCutesql("select sum(金額) from 支出 where 日期 between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", "")
B = Money1.Fields(0)
If IsNull(B) Then
B = 0
End If
Label8.Caption = B
C = A - B
If C > 0 Then
D = "富裕"
Else
D = "超支"
End If
Label13.Caption = Year(Now) & "年" & Month(Now) & "月" & "," & "本月你" & D & C & "元!"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -