Changing recordsource in one subform from another subform

R

Rod

From mySubform1 I want to change the recordsource of mySubform2


something like this

Me.Parent.mySubform2.RecordSource=mySQL


Can't get it to work though

many thanks
 
R

RoyVidar

Rod said:
From mySubform1 I want to change the recordsource of mySubform2


something like this

Me.Parent.mySubform2.RecordSource=mySQL


Can't get it to work though

many thanks

Any errormessages?

The usual stuff here, is that you need the subform control name, which
can differ from the name as viewed in the database window. Typically
you can find the correct reference when playing with the expression
builder, doubleclicking down to the subform recordsource.

Then, you also need the Form keyword.

Me.Parent!mySubform2.Form.RecordSource=mySQL

Another issue, is if you try to assign this in an event where the
subform isn't fully loaded yet.
 
Top