Display current record number?

  • Thread starter Thread starter GCMathis
  • Start date Start date
G

GCMathis

How can I display the current record number and the total number of records
on a form?

Thanks,
Gene Mathis
 
GCMathis said:
How can I display the current record number and the total number of records
on a form?
Access does not have record numbers.
The number at the bottom of the form is just the relative number for that
particular recordset, however the total number is correct.
 
Current record number:
=[Form].[CurrentRecord]

Number of records:
=[Form].[RecordsetClone].[RecordCount]
 
Hi Allen,
Access loads the entire contents of the
table (or query that you set as the recordsource) when it loads
the form so the RecordCount would always be correct right?

Another way to look at it, I remember using VBA and called
RecordCount on a recordset but the recordcount would only
show -1 until I called MoveLast to load the entire table into mem.
It then knew that no. of records that were in the recordset.

--
Luke Bellamy
Newcastle, Australia
http://www.CashWhiz.com.au


Allen Browne said:
Current record number:
=[Form].[CurrentRecord]

Number of records:
=[Form].[RecordsetClone].[RecordCount]

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


GCMathis said:
How can I display the current record number and the total number of records
on a form?
 
If the form is bound to a local table, I would expect the RecordCount to be
right once the form loads.

If it's bound to a query or attached JET table, the form's Recordset will be
of type dbOpenDynanset, not dbOpenTable, so the count will not be correct
until it is reloaded. It may therefore take a Recalc after a delay before
the box shows the right result.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


Luke Bellamy said:
Hi Allen,
Access loads the entire contents of the
table (or query that you set as the recordsource) when it loads
the form so the RecordCount would always be correct right?

Another way to look at it, I remember using VBA and called
RecordCount on a recordset but the recordcount would only
show -1 until I called MoveLast to load the entire table into mem.
It then knew that no. of records that were in the recordset.

--
Luke Bellamy
Newcastle, Australia
http://www.CashWhiz.com.au


Allen Browne said:
Current record number:
=[Form].[CurrentRecord]

Number of records:
=[Form].[RecordsetClone].[RecordCount]

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


GCMathis said:
How can I display the current record number and the total number of records
on a form?
 
Back
Top