Record Number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Access 2000, I have a form whose data I use to create an ADO recordset.
When the cursor's on a record in the form, I'd like to capture the record
number. Is there a property of the form or the recordset that I can use to
do that? Thanks!
 
Hi, Mary.

Use the form's Me.CurrentRecord Property to find the ordinal number in the
record navigation section on the form. For example, if the record navigation
section displayed "Record: 26 of 50" then using the Me.CurrentRecord
Property in VBA code would return 26.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Thank you SO much!!

'69 Camaro said:
Hi, Mary.

Use the form's Me.CurrentRecord Property to find the ordinal number in the
record navigation section on the form. For example, if the record navigation
section displayed "Record: 26 of 50" then using the Me.CurrentRecord
Property in VBA code would return 26.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
If I'm on a record (say 5), then I move to another record (say 10), and I
want to move back to 5, is the DoCmd.GoToRecord the best way?
 
Hi, Mary.

It's the easiest way. Another way is to use the RecordsetClone object and
the form's Bookmark Property to jump to the indicated record, as long as
there's a primary key in the data source of the form's Recordsource
Property.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.
 
Back
Top