Current record number of a table.

  • Thread starter Thread starter doyapore
  • Start date Start date
D

doyapore

Dear All,
How can I capture the current record number of a table which is being viewed
by the user in a form.
Thanks for your help.
 
Dear All,
How can I capture the current record number of a table which is being viewed
by the user in a form.
Thanks for your help.

Since tables do not HAVE record numbers, there is no way to do this.
Do you mean the value of a field in the table, such as an Autonumber?
If so, just put a textbox on the form to view the value of that field.

John W. Vinson[MVP]
 
Well if you can settle down with just knowing the position of a records
compared to the rest of the records in a table, which isn´t the same as
knowing which record you spot (bookmark), you could use AbsolutePosition
for a recordset.

But this may change for a specific record when you add/delete records or
sort the table since AbsolutePosition for record No 5 will en up with
AbsolutePosition = 6 when a new record is added and the new records will be
sorted before earlyer records no 5.

The best way is to use, like John said, a autonumber field in your table
which you then display on the form using a bound textcontrol. Since this
give each record a unique number.

// Niklas
 
To add one more twist to this thread, if you are looking for a sequence
number, you'll need to create your own customized numbering routine and
field. Access Autonumbers are designed to generate unique row identifiers,
but are not guaranteed to be sequential and without gaps.
 
Back
Top