T
TheOneGman
Guest
I've been trying to count the number of records that display on a subform with little luck. Right now I can count the number of records on the main form by counting the number of records listed in the listbox (using .ListCount). Once I select the subform, I can't seem to count the number of fields displayed since I'm no longer using a listbox to display the records in the subform (I'm just generating rows that are being read directly from the database).
I've tried using DLookUp and have had a little success, I can get the count from the database but once I start using the search fields on the form to narrow searches, the correct number no longer appears since it's not counting the actual records displayed on the screen but the number of records from my database that match the criteria from my clauses.
Ex.
=DLookUp("ID", "SomeForm", "ID = Me.txtID") -- Will work to count to actual number of times that ID occurs in my DB, but won't display the correct count when say I further define the search to find people with the FirstName Mike with the same ID. (10 ppl exist with that ID but only one record is displayed on the subform with that ID and the Name Mike)
Heh, not sure if that all makes sense or not. I'd apperciate any help. Thanks
I've tried using DLookUp and have had a little success, I can get the count from the database but once I start using the search fields on the form to narrow searches, the correct number no longer appears since it's not counting the actual records displayed on the screen but the number of records from my database that match the criteria from my clauses.
Ex.
=DLookUp("ID", "SomeForm", "ID = Me.txtID") -- Will work to count to actual number of times that ID occurs in my DB, but won't display the correct count when say I further define the search to find people with the FirstName Mike with the same ID. (10 ppl exist with that ID but only one record is displayed on the subform with that ID and the Name Mike)
Heh, not sure if that all makes sense or not. I'd apperciate any help. Thanks