Databases Reference
In-Depth Information
Set db = CurrentDb
Set rsTable = db.OpenRecordset("Books")
' Find first book (if any) with title beginning
' with the word "On".
rsTable.INDEX = "Title"
rsTable.Seek "=", "On"
If Not rsTable.NoMatch Then
MsgBox rsTable!Title
Else
MsgBox "No title beginning with word 'On'."
End If
rsTable.Close
End Sub
16.4.2 Finding Records in a Dynaset-Type or Snapshot-Type Recordset
To search for a record in a dynaset-type or snapshot-type recordset, Jet provides various
Find methods:
FindFirst
Finds the first matching record in the recordset.
FindNext
Finds the next matching record, starting at the current record.
FindPrevious
Finds the previous matching record, starting at the current record.
FindLast
Finds the last matching record in the recordset.
The syntax of these methods is:
RecordsetVar.FindMethod criteria
where:
RecordsetVar represents an existing dynaset-type or snapshot-type Recordset
object.
criteria is a string expression, using the same syntax as a WHERE SQL clause
(but without the word WHERE).
Search WWH ::




Custom Search