Referencing A sub form from Another subform

S

Shane

I have a Main form with 2 subs. One sub has a list of items. When I click
an item I want the second sub to change its recordsource to relect that items
components. How do I reference that second subs recordsource? Both subs are
on top of the main.
 
C

Carl Rapson

Shane said:
I have a Main form with 2 subs. One sub has a list of items. When I click
an item I want the second sub to change its recordsource to relect that
items
components. How do I reference that second subs recordsource? Both subs
are
on top of the main.

In the first subform:

Me.Parent.SecondSubformControlName.Form.RecordSource = "new record source"

Carl Rapson
 
S

SteveM

You could make the subform nested in the other subform, then the records
shown would change automatically through your linked fields...

Alternatively, you could use some event in one form to set the recordsource
property of the other form: Parent.NameOfForm.Recordsource = [your data]

Not sure if it would work in your situation, but you could have the second
subform based on a query whose criteria is the list the user is selecting
from (combo) then you could just requery the second subform in the combo's
AfterUpdate event.

Steve
 
Top