VB code help

E

EdS

Can someone help me with the VB code to do the following: VB code to retrieve the record with the highest autonumber primary key, and make it the current record on the form?

Thanks. EdS
 
D

Dan Artuso

Hi,
Something like this:
Dim lngId As Long

lngId = DMax("yourId","yourTable")
Me.recordsetClone.FindFirst "yourId = " & lngId
Me.Bookmark = Me.recordsetClone.Bookmark

Just substitute the real names for the field and table

Dan Artuso, MVP

EdS said:
Can someone help me with the VB code to do the following: VB code to retrieve the record with the highest autonumber primary
key, and make it the current record on the form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top