Candle said:
Good Afternoon,
How can I set the Recordsource property of a subform on
the fly.
Thanks
You have to get at it by way of the Form property of the subform control
on its parent form. From code on the parent form:
Me!SubformControlName.Form.RecordSource = ...
From code external to that form (and assuming the parent is a main form,
not a subform itself):
Forms!MainFormName!SubformControlName.Form.RecordSource = ...
Note that "SubformControlName" is the name of the subform *control* on
the main form, which may or may not be the same as the name of the form
object that it displays.