VBA code to move to a specific record

darkmastergyz

Registered User.
Local time
Yesterday, 23:03
Joined
May 7, 2006
Messages
85
I have a form right now, which is connected to a database table. How can I make it move to a specific record, for example, record #1?

Thanks.
 
use a filter or use docmd.goto......
 
And how do you determine which is record #1? Just as an FYI - While it may APPEAR that Access is storing records in a particular order, order to Access just doesn't mean a thing unless you give it order. If you have a primary key based on an incrementing number, then you can determine a record number, or if you have a date/time stamp. But without those imposed orders, a table of Access is an unordered set. Do a search for posts by The_Doc_Man on that as he has some good, detailed explanations.
 
Could you please give me an example of it? I have an autoprimary key, and I'd like to find a record based on the primary key.
 
Code:
With Me.Recordset
  .FindFirst "YourID = " & SomeID
  If .NoMatch Then MsgBox SomeID & " was not found"
End With
 

Users who are viewing this thread

Back
Top Bottom