shortest path to "link child fields" property

R

riyaz.mansoor

Hi

In FormOpen event of a subform I want to use the "linked child fields"
property of the "subform control" that contains the subform.

The only way I see this is:

for each ctl in subform.parent.form
if ctl.controltype = acsufform then
if subform.name = ctl.form.name then FOUND

Is there a shorter way to do this?

Riyaz
 
R

riyaz.mansoor

How about Me.Parent.Form.<nameofsubformcontrol>?

Sub form does not know the name of subformcontrol which contains it.
Hence my loop.

Specifically, I'm trying to write a general method that does. A
general method cannot have control names hardcoded.

A general method for a subform to get to the subformcontrol (that
contains the subform) in the parent form - is what i need. :(

Riyaz
 
C

Carl Rapson

Sub form does not know the name of subformcontrol which contains it.
Hence my loop.

Specifically, I'm trying to write a general method that does. A
general method cannot have control names hardcoded.

A general method for a subform to get to the subformcontrol (that
contains the subform) in the parent form - is what i need. :(

Riyaz

The I guess your way would probably be better. The only problem I could see
is if the parent form contains more than one subform. In that case, you'd
probably have to look at the Source Object property of the subform control
to see if it's the right one (surely each subform knows its own name).

Carl Rapson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top