I have a kind of general question on recordcounts.
The situation is my main form: Company has a subform: Contacts. In a global variable I am passing the company ID, so that the mainform will load with the company details as well as any associated contacts in the subform.
In the Form Open event of the mainform, I want to make the subform invisible if there are no contacts for the company.
I seem to be having difficulty getting the recordcount from the subform in the form open event on the mainform. I was thinking that the form open event is too early to get recordcounts from subforms (#??@). Anyone come up against this problem, or is familiar with object/data availability in the sequence of events?
Here's the code used to determine the subform recordcount:
[blue]subContact.Form.Requery
subContact.Form.Recordset.Recordcount[/blue]
tks
L.
The situation is my main form: Company has a subform: Contacts. In a global variable I am passing the company ID, so that the mainform will load with the company details as well as any associated contacts in the subform.
In the Form Open event of the mainform, I want to make the subform invisible if there are no contacts for the company.
I seem to be having difficulty getting the recordcount from the subform in the form open event on the mainform. I was thinking that the form open event is too early to get recordcounts from subforms (#??@). Anyone come up against this problem, or is familiar with object/data availability in the sequence of events?
Here's the code used to determine the subform recordcount:
[blue]subContact.Form.Requery
subContact.Form.Recordset.Recordcount[/blue]
tks
L.