Alex said:
Hi, I want to count the number of records in a subform. andf siplay
it on the main form.
What is the best way to do this please
One relatively easy way is to put a calculated text box in the form
header or footer section of the subform, with the Visible property of
either the section or the text box itself set to No/False, and the
ControlSource property of the text box set to
=Count(*)
Then have a *visible* calculated text box on the main form that pulls
the value from the hidden one on the subform. For example, if the
subform control (which displays the subform) is named "sfMySubform",
and text box on the subform is named "txtRecordCount", then the
control on the main form would have its ControlSource set to
=[sfMySubform]![txtRecordCount]