Displaying last record number

  • Thread starter Thread starter John Harrington
  • Start date Start date
J

John Harrington

In Access, you can very easily display the current record number.
Say, for a text box, you simply set the Control Source to "=
[CurrentRecord]".

My question: what if you want to display the number of the LAST record
in the table (put another way display the total number of records in
the table)? What do you put in the Control Source to do that?


Thanks,
John
 
In Access, you can very easily display the current record number.
Say, for a text box, you simply set the Control Source to "=
[CurrentRecord]".

My question: what if you want to display the number of the LAST record
in the table (put another way display the total number of records in
the table)?  What do you put in the Control Source to do that?

To answer my own question, I've since discovered that putting "=Count
([FieldName])" in the Control Source works, where "FieldName" is the
name of any field in the table. "=Count([FieldName])" gives the
extent of the table, including the new record (which is how they count
it in the nav bar).


John
 
John

If you are using the Nav bar, be aware that the "record numbers" there are
relative, not absolute. That is, depending on how you sort the data, or the
selection criteria, you won't always get the same "record # 7" using (only)
the Nav bar...

Regards

Jeff Boyce
Microsoft Office/Access MVP

In Access, you can very easily display the current record number.
Say, for a text box, you simply set the Control Source to "=
[CurrentRecord]".

My question: what if you want to display the number of the LAST record
in the table (put another way display the total number of records in
the table)? What do you put in the Control Source to do that?

To answer my own question, I've since discovered that putting "=Count
([FieldName])" in the Control Source works, where "FieldName" is the
name of any field in the table. "=Count([FieldName])" gives the
extent of the table, including the new record (which is how they count
it in the nav bar).


John
 
Back
Top