Solved Subform Parameters not found from Main Form

ELiedeker

Member
Local time
Today, 15:28
Joined
Sep 22, 2020
Messages
33
Hi all,

I have a subform containing a text field (SearchTerm), a checkbox (IsVegan), and an option box (Breakfast/Lunch/Dinner). I reference these controls in the query source of a combobox on the same subform to filter a list of Recipes. It works great as a stand-alone form.

However, I pasted this subform into the header of a main form (Menu Planner) and when I open the main form, it presents me with a dialog for each of the subform controls. Is this not the way subforms are designed to work? Is there a workaround?

TIA!
Eileen
 
Hi Eileen. You're probably using an absolute reference to those textboxes in the form of Forms!FormName.TextboxName

If so, once you make FormName a subform to another form, that reference breaks, because the path has changed.

It now becomes something like this: Forms!MainFormName.SubformContainerName.Form!TextboxName

Please note, you want to use the name of the Subform Container, rather than the name of the Form it contains. That name may be the same as the form; but sometimes, it could be different.
 
Excellent! That did it, and now I understand more about how control references work. Thanks so much!!!
 

Users who are viewing this thread

Back
Top Bottom