Seek Method Example

This example uses Seek to locate the first record in the Publishers table where the PubID field is 3, using the existing primary key index.


Dim MyDB As Database, MyTable As Table
Set MyDB = OpenDatabase("BIBLIO.MDB")      ' Open a database.
Set MyTable = MyDB.OpenTable("Publishers") ' Open a table.
MyTable.Index = "PrimaryKey"               ' Define current index.
MyTable.Seek "=", 3                        ' Seek record.
If MyTable.NoMatch Then...