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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Count incorrect when form first opened 1

Status
Not open for further replies.

RobotMush

Technical User
Aug 18, 2004
197
US
I have created a =Recordset.RecordCount as the control source for a text table. It works very well when you click to the next page to show the number of records. However, when the form is first opened it shows the Number of Records as being 1. How can I get the text box to show the correct number of records when the form if first opened?

Thank you for your help

RobotMush
 
In the Load event procedure of the form:
Echo False
Me.Recordset.MoveLast
Me.Recordset.MoveFirst
Echo True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you PHV, It seems to be working fine now, by chance would you know how to display the record number itself?

Thank You

RobotMush (Technical user)
 
=(1 + Recordset.AbsolutePosition) & "/" Recordset.RecordCount

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV, I can use that. Have a star.
 
It Don't work
Any chance you could elaborate ?
Some error message ? Unexpected behaviour ? Application crash ? ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I did a cut and past to what you suggested I use and placed it in the Control Source of the Properties of the Text Box. The first error I got was a missing operand, was able to fix that by adding the second & after the & "/". So that allowed me to run it. However, The number(s) that appear before the '/' does not flow sequentially. I can go through three records before the first number changes. As I move about through 5 filtered records the number count goes... 1 1 2 3 4 or if I jump to the last and go backwards I get 1 3 2 1 5. Do you have any suggestions?

Thank you for your help

RobotMush (Technical User)
 
You may Requery or Recalc this control in the Current event procedure.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top