Get subform's control in the main form.

dudezzz

Registered User.
Local time
Today, 11:27
Joined
Feb 17, 2005
Messages
66
Lets say I have Form A and Subform A with the parent-child relationship established that works well. Subform A has a Text box control that is getting display when I include the subform in Form A.


Now, I decided I dont want to include subform A in the Form A. Is there a way for me to show the contents of that Text box control in Form A without attaching the subform in the main form (Form A)?

I read somewhere that to refer a control on a subform, I have to use the code - Forms!mainform!subform.form!control. But this would be in VBA. What is the equivalent of this in a Control Source in the main form?

If I have not explained myself correctly, please do let me know.

To summarize, my question is without including the subform, I want to reference the values of the subform in the mainform. (I have some design necessity for this requirement) Is there a way for this?

thanks!
 
Last edited:
You cannot reference to data in a control on a form without that form being open somewhere..either as a subform or as a separate form.

That said, you could solve this a few ways.

1) do not link to the form control at all, directly link to the source of the data (table/query) the subform was using. - best possible solution?

2) add the subform, but hide it. A poor but simple solution.

3) use code to open the other form hidden, then update the main form. A poor and complex solution
 

Users who are viewing this thread

Back
Top Bottom