Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form's Recordcount

Status
Not open for further replies.

ShinyPen

MIS
Nov 6, 2002
10
0
0
GB
Hi.

I have a text box on a form with the control source set to

=[Forms].[formname].[RecordsetClone].[RecordCount]

There are 1319 records in the recordset.

The first time I open this form it gets the count wrong and displays 501. However If I change the form's view to "design" and then back to "form" it gets the recordcount right. This is the only way it will work. It's been driving me mad for days!

Does anybody have any ideas why it would do this?

Many thanks in advance.
 
Hi

RecordCount is not reliably populated until you have moved to the last record in the recordset

try (in form open or form load)

Me.RecordsetClone.MoveLast
Me.RecordsetClone.MoveFirst

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
It works! Thanks a lot Ken.

I'm too relieved to be embarrassed at how simple the answer was!

Once again, thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top