📄 main_find.frm
字号:
End
Begin MSComCtl2.DTPicker DtpDateS
Height = 330
Left = 7125
TabIndex = 0
Top = 195
Width = 1650
_ExtentX = 2910
_ExtentY = 582
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 59441153
CurrentDate = 36640
End
Begin MSComCtl2.DTPicker DtpDateE
Height = 330
Left = 9165
TabIndex = 1
Top = 195
Width = 1620
_ExtentX = 2858
_ExtentY = 582
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Format = 59441153
CurrentDate = 36580
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MS1
Bindings = "Main_Find.frx":15F986
Height = 3435
Left = 105
TabIndex = 13
Top = 1275
Width = 11070
_ExtentX = 19526
_ExtentY = 6059
_Version = 393216
BackColorFixed = 16761024
BackColorBkg = 14725311
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin VB.Shape Shape3
Height = 555
Left = 8190
Top = 4785
Width = 2940
End
Begin VB.Shape Shape2
Height = 555
Left = 75
Top = 4785
Width = 8130
End
Begin VB.Shape Shape1
Height = 1125
Left = 90
Top = 90
Width = 11070
End
Begin VB.Label LblRecordCount
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 255
Left = 750
TabIndex = 11
Top = 4965
Width = 1260
End
Begin VB.Label LblMoney
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 255
Left = 3195
TabIndex = 9
Top = 4965
Width = 3930
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "设置查询内容:"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 180
TabIndex = 4
Top = 675
Width = 2145
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "设置查询时间段: 至"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 4650
TabIndex = 3
Top = 180
Width = 4635
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "设置刊物:"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 480
TabIndex = 2
Top = 195
Width = 1515
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "记录: 汇总金额: 元"
Height = 225
Left = 165
TabIndex = 10
Top = 4965
Width = 7695
End
End
Attribute VB_Name = "Main_Find"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim myval As Currency
Private Sub Form_Activate()
DtpDateS.Value = Date - 10
DtpDateE.Value = Date
MS1.ColWidth(0) = 12 * 25 * 1.15
MS1.ColWidth(1) = 12 * 25 * 6
MS1.ColWidth(2) = 12 * 25 * 5
MS1.ColWidth(3) = 12 * 25 * 5
MS1.ColWidth(4) = 12 * 25 * 5
MS1.ColWidth(5) = 12 * 25 * 5
MS1.ColWidth(6) = 12 * 25 * 5
MS1.ColWidth(7) = 12 * 25 * 5
MS1.ColWidth(8) = 12 * 25 * 5
MS1.ColWidth(9) = 12 * 25 * 5
MS1.TextMatrix(0, 0) = "xh"
myval = 0
If Not Adodc1.Recordset.BOF Then Adodc1.Recordset.MoveFirst
For i = 1 To Adodc1.Recordset.RecordCount
myval = Val(Adodc1.Recordset.Fields("金额")) + myval
MS1.TextMatrix(i, 0) = i
If Not Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveNext
Next i
LblMoney.Caption = Format(myval, "0.00")
LblRecordCount.Caption = Adodc1.Recordset.RecordCount
End Sub
Private Sub CmdFind_Click()
If Check1.Value = 0 And Check2.Value = 0 Then
Adodc1.RecordSource = "select * from 稿费发放表 where 稿费发放表." & Combo1.Text & " like +'" + Text1.Text + "'+'%'"
Adodc1.Refresh
Adodc2.RecordSource = "select sum(金额)as 金额1,count(*)as 序号1 from 稿费发放表 where 稿费发放表." & Combo1.Text & " like +'" + Text1.Text + "'+'%'"
Adodc2.Refresh
End If
If Check1.Value = 0 And Check2.Value = 1 Then
Adodc1.RecordSource = "select * from 稿费发放表 where 日期 between '" + Str(DtpDateS.Value) + "'AND '" + Str(DtpDateE.Value) + "'and 稿费发放表." & Combo1.Text & " like +'" + Text1.Text + "'+'%'"
Adodc1.Refresh
Adodc2.RecordSource = "select sum(金额)as 金额1,count(*)as 序号1 from 稿费发放表 where 日期 between '" + Str(DtpDateS.Value) + "'AND '" + Str(DtpDateE.Value) + "'and 稿费发放表." & Combo1.Text & " like +'" + Text1.Text + "'+'%'"
Adodc2.Refresh
End If
If Check1.Value = 1 And Check2.Value = 0 Then
Adodc1.RecordSource = "select * from 稿费发放表 where 稿费发放表." & Combo1.Text & " like +'" + Text1.Text + "'+ '%'and 刊物名称 like +'" + DataCombo1.Text + "'"
Adodc1.Refresh
Adodc2.RecordSource = "select sum(金额)as 金额1,count(*)as 序号1 from 稿费发放表 where 稿费发放表." & Combo1.Text & " like +'" + Text1.Text + "'+'%' and 刊物名称 like +'" + DataCombo1.Text + "'"
Adodc2.Refresh
End If
If Check1.Value = 1 And Check2.Value = 1 Then
Adodc1.RecordSource = "select * from 稿费发放表 where 日期 between '" + Str(DtpDateS.Value) + "'AND '" + Str(DtpDateE.Value) + "'and 稿费发放表." & Combo1.Text & " like +'" + Text1.Text + "'+'%'and 刊物名称 like +'" + DataCombo1.Text + "'"
Adodc1.Refresh
Adodc2.RecordSource = "select sum(金额)as 金额1,count(*)as 序号1 from 稿费发放表 where 日期 between '" + Str(DtpDateS.Value) + "'AND '" + Str(DtpDateE.Value) + "'and 稿费发放表." & Combo1.Text & " like +'" + Text1.Text + "'+'%'and 刊物名称 like +'" + DataCombo1.Text + "'"
Adodc2.Refresh
End If
If Adodc2.Recordset.Fields(0) <> "" Then LblMoney.Caption = Adodc2.Recordset.Fields(0) Else LblMoney.Caption = "0.00"
If Adodc2.Recordset.Fields(1) <> "" Then LblRecordCount.Caption = Adodc2.Recordset.Fields(1) Else LblRecordCount.Caption = "0"
End Sub
Private Sub CmdFindAll_Click()
Adodc1.RecordSource = "select * from 稿费发放表 "
Adodc1.Refresh
Adodc2.RecordSource = "select sum(金额)as 金额1,count(*)as 序号1 from 稿费发放表 "
Adodc2.Refresh
If Adodc2.Recordset.Fields(0) <> "" Then LblMoney.Caption = Adodc2.Recordset.Fields(0) Else LblMoney.Caption = "0.00"
If Adodc2.Recordset.Fields(1) <> "" Then LblRecordCount.Caption = Adodc2.Recordset.Fields(1) Else LblRecordCount.Caption = "0"
End Sub
Private Sub CmdEnd_Click()
Frm_Main.Show
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -