📄 frm_query.frm
字号:
CurrentDate = 37836
End
Begin MSComCtl2.DTPicker DTPicker3
Height = 300
Left = -72720
TabIndex = 15
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Format = 24772609
CurrentDate = 37836
End
Begin MSComCtl2.DTPicker DTPicker4
Height = 300
Left = -71040
TabIndex = 16
Top = 600
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Format = 24772609
CurrentDate = 37836
End
Begin VB.Label Label6
Caption = "元"
Height = 255
Left = -71280
TabIndex = 20
Top = 2040
Width = 255
End
Begin VB.Label Label5
Caption = "到"
Height = 255
Left = -71280
TabIndex = 19
Top = 600
Width = 255
End
Begin VB.Label Label4
Caption = "从"
Height = 255
Left = -72960
TabIndex = 18
Top = 600
Width = 375
End
Begin VB.Label Label2
Caption = "到"
Height = 255
Left = 3720
TabIndex = 10
Top = 600
Width = 255
End
Begin VB.Label Label1
Caption = "从"
Height = 255
Left = 2040
TabIndex = 9
Top = 600
Width = 375
End
Begin VB.Label Label3
Caption = "元"
Height = 255
Left = 3720
TabIndex = 6
Top = 2040
Width = 375
End
End
End
Attribute VB_Name = "frm_query"
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 Mydb2 As New ADODB.Recordset
Dim Mydb3 As New ADODB.Recordset
Dim Mydb4 As New ADODB.Recordset
Dim Mydb5 As New ADODB.Recordset
Dim Mydb10 As New ADODB.Recordset
Dim Mydb11 As New ADODB.Recordset
Dim Mydb12 As New ADODB.Recordset
Dim Str_text As String
Dim Riqi, Riqi1, Riqi3, Riqi4
Private Sub Chk_date1_Click()
If Chk_date1.Value = 1 Then
Chk_mode1.Value = 0
Chk_money1.Value = 0
Chk_project1.Value = 0
End If
End Sub
Private Sub Chk_mode1_Click()
If Chk_mode1.Value = 1 Then
Chk_money1.Value = 0
Chk_project1.Value = 0
Chk_date1.Value = 0
End If
End Sub
Private Sub Chk_money1_Click()
If Chk_money1.Value = 1 Then
Chk_mode1.Value = 0
Chk_project1.Value = 0
Chk_date1.Value = 0
End If
End Sub
Private Sub Chk_project1_Click()
If Chk_project1.Value = 1 Then
Chk_mode1.Value = 0
Chk_date1.Value = 0
Chk_money1.Value = 0
End If
End Sub
Private Sub Command1_Click()
If Chk_date.Value = 1 Then
Call Criqi
End If
If Chk_mode.Value = 1 Then
Call Mode
End If
If Chk_money = 1 Then
Call Money
End If
If Chk_project.Value = 1 Then
Call Project
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
If Chk_date1.Value = 1 Then
Call Criqi1
End If
If Chk_mode1.Value = 1 Then
Call Mode1
End If
If Chk_money1 = 1 Then
Call Money1
End If
If Chk_project1.Value = 1 Then
Call Project1
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Function Criqi()
Riqi = Format(DTPicker1.Value, "yyyy-mm-dd")
Riqib = Format(DTPicker2.Value, "yyyy-mm-dd")
Set Mydb = ExeCutesql("select * from 收入 where 日期 between 'Riqi'and 'Riqi1'", Str_text)
Set MSHFlexGrid1.DataSource = Mydb
End Function
Private Function Mode()
Set Mydb1 = ExeCutesql("select * from 收入 where 方式='" & Combo1.Text & "'", Str_text)
Set MSHFlexGrid1.DataSource = Mydb1
End Function
Private Function Money()
On Error Resume Next
Dim B
B = CInt(txt_money.Text)
Set Mydb2 = ExeCutesql("select * from 收入 where 金额=" & B & " ", Str_text)
Set MSHFlexGrid1.DataSource = Mydb2
End Function
Private Function Project()
Set Mydb3 = ExeCutesql("select * from 收入 where 项目='" & Combo2.Text & "'", Str_text)
Set MSHFlexGrid1.DataSource = Mydb3
End Function
Private Sub Form_Load()
On Error Resume Next
Dim A, B
Set Mydb4 = ExeCutesql("select * from 收入项目", Str_text)
A = Mydb4.RecordCount
For I = 1 To A
Combo2.AddItem Mydb4.Fields(0)
Mydb4.MoveNext
If Mydb4.EOF Then Exit For
Next I
Set Mydb5 = ExeCutesql("select * from 支出项目", Str_text)
B = Mydb5.RecordCount
For I = 1 To B
Combo4.AddItem Mydb5.Fields(0)
Mydb5.MoveNext
If Mydb5.EOF Then Exit For
Next I
DTPicker1.Value = Date
DTPicker2.Value = Date
DTPicker3.Value = Date
DTPicker4.Value = Date
End Sub
Private Function Criqi1()
Riqi3 = Format(DTPicker3.Value, "yyyy-mm-dd")
Riqib4 = Format(DTPicker4.Value, "yyyy-mm-dd")
Set Mydb10 = ExeCutesql("select * from 支出 where 日期 between 'Riqi3'and 'Riqi4'", Str_text)
Set MSHFlexGrid2.DataSource = Mydb10
End Function
Private Function Mode1()
Set Mydb1 = ExeCutesql("select * from 支出 where 方式='" & Combo3.Text & "'", Str_text)
Set MSHFlexGrid2.DataSource = Mydb1
End Function
Private Function Money1()
On Error Resume Next
Dim B
B = CInt(txt_money1.Text)
Set Mydb11 = ExeCutesql("select * from 支出 where 金额=" & B & " ", Str_text)
Set MSHFlexGrid2.DataSource = Mydb11
End Function
Private Function Project1()
Set Mydb12 = ExeCutesql("select * from 支出 where 项目='" & Combo4.Text & "'", Str_text)
Set MSHFlexGrid2.DataSource = Mydb12
End Function
Private Sub Chk_date_Click()
If Chk_date.Value = 1 Then
Chk_mode.Value = 0
Chk_money.Value = 0
Chk_project.Value = 0
End If
End Sub
Private Sub Chk_mode_Click()
If Chk_mode.Value = 1 Then
Chk_money.Value = 0
Chk_project.Value = 0
Chk_date.Value = 0
End If
End Sub
Private Sub Chk_money_Click()
If Chk_money.Value = 1 Then
Chk_mode.Value = 0
Chk_project.Value = 0
Chk_date.Value = 0
End If
End Sub
Private Sub Chk_project_Click()
If Chk_project.Value = 1 Then
Chk_mode.Value = 0
Chk_date.Value = 0
Chk_money.Value = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -