E
esn
Hey everybody,
First off, I apologize in advance for the simplicity of this
question. I know next to nothing about VBA.
I've got a form ("Mammal ID Manual") with a subform ("Mammal ID Manual
Subform") and I want to force the subform to load after the main form
has loaded to avoid error messages. The record source for the subform
includes values from the main form as criteria in a pretty complex
way, so loading the subform first doesn't really make any sense.
Searching around I've found suggestions to use the on load event in
the main form to change the subform's record source. So this is what
I tried:
Private Sub Form_Load()
Forms![Mammal ID Manual]![Mammal ID Manual Subform].RecordSource =
"SM - Mammal ID - 1 Mark Match"
End Sub
"SM - Mammal ID - 1 Mark Match" is the name of the query that should
be the record source for the subform. I cleared the record source
property on the subform, then opened the main form and I get a runtime
error stating that the object doesn't support this property or
method. Where did I screw up?
First off, I apologize in advance for the simplicity of this
question. I know next to nothing about VBA.
I've got a form ("Mammal ID Manual") with a subform ("Mammal ID Manual
Subform") and I want to force the subform to load after the main form
has loaded to avoid error messages. The record source for the subform
includes values from the main form as criteria in a pretty complex
way, so loading the subform first doesn't really make any sense.
Searching around I've found suggestions to use the on load event in
the main form to change the subform's record source. So this is what
I tried:
Private Sub Form_Load()
Forms![Mammal ID Manual]![Mammal ID Manual Subform].RecordSource =
"SM - Mammal ID - 1 Mark Match"
End Sub
"SM - Mammal ID - 1 Mark Match" is the name of the query that should
be the record source for the subform. I cleared the record source
property on the subform, then opened the main form and I get a runtime
error stating that the object doesn't support this property or
method. Where did I screw up?