Requery

R

Reggie Laffond

I have a continuous form with a unique customer key as one of the fields on
each line. Is there a way in code to determine the value of the key field
that is in the first row? If I use Forms!frmMain.KeyField I get the row that
has focus but I want row 1 no matter what row has focus.

I want to reposition the form after a requery.

Thanks for the help.
 
G

Guest

You can use the RecordsetClone. When you open it, it will be positioned on
the first record in the recordset. As it is a clone of the form's recordset,
it will be the same as the form's recordset:

Set rst = Me.RecordSetClone
strFirstRecord = rst![YourKeyField]
 

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