VBA code to move to a specific record (1 Viewer)

darkmastergyz

Registered User.
Local time
Today, 03:43
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.
 

KeithG

AWF VIP
Local time
Today, 03:43
Joined
Mar 23, 2006
Messages
2,592
use a filter or use docmd.goto......
 

boblarson

Smeghead
Local time
Today, 03:43
Joined
Jan 12, 2001
Messages
32,059
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.
 

darkmastergyz

Registered User.
Local time
Today, 03:43
Joined
May 7, 2006
Messages
85
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.
 

MarkK

bit cruncher
Local time
Today, 03:43
Joined
Mar 17, 2004
Messages
8,178
Code:
With Me.Recordset
  .FindFirst "YourID = " & SomeID
  If .NoMatch Then MsgBox SomeID & " was not found"
End With
 

Users who are viewing this thread

Top Bottom