RecordCount not accurate

  • Thread starter Thread starter Shiller
  • Start date Start date
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!
 
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!
 
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.
 
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... :)
 
Back
Top