📄 findform.frm
字号:
VERSION 5.00
Begin VB.Form findForm
AutoRedraw = -1 'True
BackColor = &H00808000&
BorderStyle = 3 'Fixed Dialog
ClientHeight = 2100
ClientLeft = 45
ClientTop = 330
ClientWidth = 5295
Icon = "findForm.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2100
ScaleWidth = 5295
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
BackColor = &H00808000&
Caption = "查询条件 "
ForeColor = &H000000C0&
Height = 1185
Left = 75
TabIndex = 3
Top = 135
Width = 5085
Begin VB.TextBox Text1
Height = 315
Left = 2625
MaxLength = 30
TabIndex = 0
Top = 510
Width = 2130
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1260
Style = 2 'Dropdown List
TabIndex = 5
Top = 510
Width = 1125
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品名称:"
ForeColor = &H0000FFFF&
Height = 180
Left = 300
TabIndex = 4
Top = 585
Width = 900
End
End
Begin VB.CommandButton closeform
Cancel = -1 'True
Caption = "放弃"
Height = 375
Left = 2925
TabIndex = 2
Top = 1530
Width = 1020
End
Begin VB.CommandButton Sure
Caption = "查找"
Default = -1 'True
Enabled = 0 'False
Height = 375
Left = 1335
TabIndex = 1
Top = 1530
Width = 1020
End
End
Attribute VB_Name = "findForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Closeform_Click()
Unload Me
End Sub
Private Sub Form_Load()
'初始化列表框
Combo1.AddItem "等于", 0
Combo1.AddItem "包含", 1
Combo1.ListIndex = 0
End Sub
Private Sub Sure_Click()
Dim findStr As String
If Combo1.Text = "等于" Then
findStr = "品名='" & Trim(Text1.Text) & "'"
Else
findStr = "品名 Like '*" & Trim(Text1.Text) & "*'"
End If
'查找记录
PublicFindstr = findStr
cpform.Data1.Recordset.FindFirst findStr
If cpform.Data1.Recordset.NoMatch Then
MsgBox "没有查找到您的产品", vbOKOnly + 48, "查找产品"
'查找下一个为假
cpform.Nextfind.Enabled = False
Exit Sub
End If
'关闭查找窗口
'查找下一个为真
cpform.Nextfind.Enabled = True
Unload Me
End Sub
Private Sub Text1_Change()
If Trim(Text1.Text) = "" Then
sure.Enabled = False
Else
sure.Enabled = True
End If
End Sub
Private Sub Text1_Click()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And sure.Enabled = True Then
sure.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -