📄 frm_qtfycx.frm
字号:
ColumnWidth = 870.236
EndProperty
BeginProperty Column04
ColumnWidth = 824.882
EndProperty
BeginProperty Column05
ColumnWidth = 780.095
EndProperty
BeginProperty Column06
ColumnWidth = 1170.142
EndProperty
BeginProperty Column07
ColumnWidth = 1395.213
EndProperty
EndProperty
End
End
Begin VB.Frame Frame1
Height = 885
Left = 75
TabIndex = 0
Top = 45
Width = 7770
Begin VB.Frame Frame2
Height = 645
Left = 5955
TabIndex = 8
Top = 120
Width = 1755
Begin VB.CommandButton Command2
Caption = "退出"
Height = 345
Left = 885
TabIndex = 10
Top = 165
Width = 750
End
Begin VB.CommandButton Command1
Caption = "查询"
Height = 345
Left = 90
TabIndex = 9
Top = 165
Width = 750
End
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Left = 4485
TabIndex = 7
Top = 330
Width = 1290
End
Begin VB.ComboBox Combo2
Enabled = 0 'False
Height = 300
ItemData = "Frm_qtfycx.frx":1C7A
Left = 3195
List = "Frm_qtfycx.frx":1C7C
Style = 2 'Dropdown List
TabIndex = 6
Top = 330
Width = 1290
End
Begin VB.ComboBox Combo1
Enabled = 0 'False
Height = 300
ItemData = "Frm_qtfycx.frx":1C7E
Left = 1695
List = "Frm_qtfycx.frx":1C8B
Style = 2 'Dropdown List
TabIndex = 5
Top = 330
Width = 1500
End
Begin VB.OptionButton Option2
Caption = "按计费日期查询"
Height = 330
Left = 90
TabIndex = 4
Top = 1260
Width = 1575
End
Begin VB.OptionButton Option1
Caption = "请选择查询条件"
Height = 375
Left = 90
TabIndex = 3
Top = 330
Width = 1665
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 315
Left = 4530
TabIndex = 1
Top = 1245
Width = 1290
_ExtentX = 2275
_ExtentY = 556
_Version = 393216
Enabled = 0 'False
Format = 65863681
CurrentDate = 38211
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 315
Left = 2505
TabIndex = 2
Top = 1245
Width = 1290
_ExtentX = 2275
_ExtentY = 556
_Version = 393216
Enabled = 0 'False
Format = 65863681
CurrentDate = 38211
End
Begin VB.TextBox Text2
Height = 285
Left = 2565
TabIndex = 15
Text = "Text2"
Top = 1260
Width = 1080
End
Begin VB.TextBox Text3
Height = 270
Left = 4515
TabIndex = 16
Text = "Text3"
Top = 1230
Width = 1185
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "结束日期"
Height = 180
Left = 3765
TabIndex = 12
Top = 1305
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "起始日期"
Height = 180
Left = 1710
TabIndex = 11
Top = 1305
Width = 720
End
End
End
Attribute VB_Name = "Frm_qtfycx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
DTPicker1.Value = Date
DTPicker2.Value = Date
'自动识别路径
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from tab_othermoney"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Combo2.AddItem ("=")
Combo2.AddItem (">")
Combo2.AddItem ("<")
Combo2.AddItem ("<>")
Combo2.AddItem ("like")
Combo2.ListIndex = 0
'ComboBox 控件将 TextBox 控件和 ListBox 控件的特性结合在一起-既可以在控件的文本框部分输入信息,也可以在控件的列表框部分选择一项。
End Sub
Private Sub Option1_Click() '请选择查询条件
Combo1.Enabled = True
Combo2.Enabled = True
Text1.Enabled = True
DTPicker1.Enabled = False
DTPicker2.Enabled = False
'DateTimePicker控件使您可以提供格式化的日期字段,使得进行日期选择很容易。另外,用户还可以从类似于MonthView控件的下拉式日历界面中选择日期。
Text1.SetFocus
End Sub
Private Sub Option2_Click() '按计费日期查询
DTPicker1.Enabled = True
DTPicker2.Enabled = True
Combo1.Enabled = False
Combo2.Enabled = False
Text1.Enabled = False
End Sub
Private Sub Command1_Click() '查询
If Combo1.Enabled = True Then
If Combo2.Text = "like" Then
Adodc1.RecordSource = "select * from tab_othermoney where " & Combo1.Text & " like +'%" & Text1.Text & "%'"
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from tab_othermoney where " & Combo1.Text & " " & Combo2.Text & " '" & Text1.Text & "'"
Adodc1.Refresh
End If
Else
Adodc1.RecordSource = "select * from tab_othermoney where 计费起始日期=" + Chr(35) + Str(DTPicker1.Value) + Chr(35) + "and 计费终止日期=" + Chr(35) + Str(DTPicker2.Value) + Chr(35) + ""
'Str 函数返回代表一数值的 Variant (String)。
Adodc1.Refresh
End If
End Sub
Private Sub Command2_Click() '退出
Unload Me
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Command1.SetFocus '按回车键Command1获得焦点
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -