【VB开源代码栏目提醒】:网学会员VB开源代码为您提供Findfrm.frm参考,解决您在Findfrm.frm学习中工作中的难题,参考学习。
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Begin VB.Form Findfrm
BorderStyle = 3 'Fixed Dialog
Caption = "查找图书"
ClientHeight = 6000
ClientLeft = 45
ClientTop = 330
ClientWidth = 7740
Icon = "Findfrm.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6000
ScaleWidth = 7740
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.PictureBox Picture2
BorderStyle = 0 'None
Height = 735
Left = 2520
ScaleHeight = 735
ScaleWidth = 3135
TabIndex = 10
Top = 2280
Width = 3135
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "以实现多个记录的查找"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 180
Left = 0
TabIndex = 12
Top = 360
Width = 1800
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "提示:书名
查询可输入*来代替多个字符"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 180
Left = 0
TabIndex = 11
Top = 120
Width = 3060
End
End
Begin MSComctlLib.ListView LV
Height = 2535
Left = 120
TabIndex = 9
Top = 3360
Width = 7455
_ExtentX = 13150
_ExtentY = 4471
Sorted = -1 'True
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
ForeColor = 32768
BackColor = 16777215
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 0
End
Begin VB.CommandButton Command1
Cancel = -1 'True
Caption = "关 闭(&C)"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6240
TabIndex = 8
ToolTipText = "关闭此对话框"
Top = 2640
Width = 1335
End
Begin VB.CommandButton cmdKong
Caption = "全部清空(&L)"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6240
TabIndex = 7
ToolTipText = "清空所有文本"
Top = 1200
Width = 1335
End
Begin VB.CommandButton cmdBeginFind
Caption = "开始查找(&F)"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6240
TabIndex = 6
ToolTipText = "开始查找符合条件的记录"
Top = 600
Width = 1335
End
Begin VB.TextBox txtBookName
ForeColor = &H00FF0000&
Height = 375
Left = 2520
TabIndex = 5
Text = "Text1"
Top = 1800
Width = 3135
End
Begin
VB.TextBox txtBookBian
ForeColor = &H00FF0000&
Height = 360
Left = 2520
TabIndex = 0
Text = "Text1"
Top = 1200
Width = 3135
End
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 2175
Left = 600
ScaleHeight = 2175
ScaleWidth = 1815
TabIndex = 2
Top = 720
Width = 1815
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "书 名"
ForeColor = &H00FF0000&
Height = 180
Index = 1
Left = 720
TabIndex = 4
Top = 1320
Width = 630
End
Begin VB.Image Image1
Height = 480
Left = 0
Picture = "Findfrm.frx":0442
Top = 360
Width = 480
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "图书编号"
ForeColor = &H00FF0000&
Height = 180
Index = 0
Left = 720
TabIndex = 3
Top = 600
Width = 720
End
End
Begin MSComctlLib.TabStrip TabStrip1
Height = 2895
Left = 120
TabIndex = 1
Top = 240
Width = 5775
_ExtentX = 10186
_ExtentY = 5106
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 1
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "查找"
ImageVarType = 2
EndProperty
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Attribute VB_Name = "Findfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst1 As Recordset '打开表Book
Dim rst2 As Recordset '打开表BookFf
Dim rst As Recordset
Dim db1 As Database
Dim db2 As Database
Dim qry1 As QueryDef
Dim qry2 As QueryDef
Dim RecNum As Integer '查找符合条件总记录数
Dim i As Integer
Dim FindStr As String '查找SQL语句
Private Sub cmdBeginFind_Click()
If txtBookBian = "" And txtBookName = "" Then
MsgBox "请填写相关查找信息!", 0 + 48, "提示"
txtBookBian.SetFocus
Exit Sub
End If
Lv.ListItems.Clear
Findfrm.MousePointer = 11