Solved Subform Parameters not found from Main Form (1 Viewer)

ELiedeker

Member
Local time
Today, 03:05
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:05
Joined
Oct 29, 2018
Messages
21,358
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.
 

ELiedeker

Member
Local time
Today, 03:05
Joined
Sep 22, 2020
Messages
33
Excellent! That did it, and now I understand more about how control references work. Thanks so much!!!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:05
Joined
Oct 29, 2018
Messages
21,358
Excellent! That did it, and now I understand more about how control references work. Thanks so much!!!
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom