RecordCount not accurate

S

Shiller

Experts,

I've been using the following piece of code in the Control Source
property of a text box on my main form to get the recordcount of a
subfomr:
=[SubFormControlName].[Form].[recordset].[RecordCount]

It works overall, but the record count is not always accurate.

any suggestions!
 
R

ruralguy via AccessMonster.com

A Recordset.RecordCount is not guaranteed accurate until the recordset has
done a .MoveLast!
Experts,

I've been using the following piece of code in the Control Source
property of a text box on my main form to get the recordcount of a
subfomr:
=[SubFormControlName].[Form].[recordset].[RecordCount]

It works overall, but the record count is not always accurate.

any suggestions!
 
M

Marshall Barton

Shiller said:
I've been using the following piece of code in the Control Source
property of a text box on my main form to get the recordcount of a
subfomr:
=[SubFormControlName].[Form].[recordset].[RecordCount]

It works overall, but the record count is not always accurate.


That's the way it works.

A way to get the total count is to use:
Me.Recordset.MoveLast
Me.Recordset.MoveFirst
in the form's Load event procedure.
 
S

Shiller

Shiller said:
I've been using the following piece of code in the Control Source
property of a text box on my main form to get the recordcount of a
subfomr:
=[SubFormControlName].[Form].[recordset].[RecordCount]
It works overall, but the record count is not always accurate.

That's the way it works.

A way to get the total count is to use:
Me.Recordset.MoveLast
Me.Recordset.MoveFirst
in the form's Load event procedure.

Thank you so much Marsh,

It works... :)
 

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

Similar Threads

RecordCount problem 2
Recordcount in ADO 10
Recordcount is always 1 step behind. 1
RecordCount 12
Code works in 2000 but error in 2003 3
recordset clone recordcount ? 1
Run-time error 3021 6
Date WHERE & RecordCount 5

Top