Unanswered: Showing subform's row count on main form
How can I add a field to my main form that dynamically shows the total # of rows shown in a subform? (I then want to use that count for another field on the main form that has a mathmatical equation.)
I've tried doing a count on the subform in the header/footer then referencing that subform field in the main form but that doesn't work. With reports, I've summed fields in a subform and showed it on the main form but I can't find a similar approach (though I'm now doing count, not sum) for forms.
Sounds easy but....
Thanks in advance for any detailed, accurate replies you can provide.
Can you take the easy way out and make the Record Selector visible in the subform? Then you get the record count for free (but it is not available for calculations).
To use the count for another calculation, you will probably need to use the AfterUpdate event of your combo box that chooses the master record and then run a DCount function that populates a text box on the main form. Domain functions are expensive (per the Access help system, which is pretty helpful on DCount, DSum, etc.) but if you need it you need it. You can also put the DCount directly in a text box and force a refresh of the text box if it doesn't already happen automatically.