Display current record number?

G

GCMathis

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

Thanks,
Gene Mathis
 
M

Mike Painter

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.
 
A

Allen Browne

Current record number:
=[Form].[CurrentRecord]

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

Luke Bellamy

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?
 
A

Allen Browne

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?
 

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