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!

Counting rows on a form from VBA.

Status
Not open for further replies.

jakeisstoked

Technical User
May 9, 2003
28
AU
Hi,
I have this form, and I need to count the rows in VB so I can store it in a variable and do stuff with it, I know how to count rows on a form by using a textbox with a control source set to "=Count([some_ID])" or whatever, but that's pointless to me. Can I do it directly from VB? Or can I query the forms data source (and again, I couldn't figure that out for the life of me).
I realise this is very trivial, but it seems to me that Access VB has no less than 10 billion similarly named objects and properties and I've been 'google-ing' for hours and I still have no clue at all.
Any help would save my life,
Thanks,
Jake
 
What about something like Me.RecordsetClone.RecordCount ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi
Have you tried putting something like:
intCount=Me.RecordsetClone.RecordCount
in the form's module?
 
Thanks that's what I was after, I swear I tried Me.Something.RecordCount a hundred times. Cheers again.

-Jake
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top