FindFirst, FindLast, FindNext, FindPrevious Methods Example 2 (Professional Edition Only)

This example creates a Dynaset and then uses FindFirst to locate the first record satisfying the title condition.

Dim MyCriteria As String, MyDB As Database, MySet As Dynaset
MyCriteria = "State = 'NY'"             ' Define search criteria.
Set MyDB = OpenDatabase("BIBLIO.MDB")
' Create a Dynaset based on Publishers table.
Set MySet = MyDB.CreateDynaset("Publishers")
MySet.FindFirst MyCriteria              ' Find first matching record.
If Not Data1.Recordset.NoMatch Then...  ' Check if record is found.
...
MySet.FindNext MyCriteria               ' Find next matching record.