Referring to Sub-Form Control in a Query

J

JimP

How do you refer to a sub-form control (on an open form) in a query? The
code below is incorrect and opens the "Enter Parameter value" window.

Forms!MainForm!SubForm.Forms!ControlName
 
S

Stuart McCall

JimP said:
How do you refer to a sub-form control (on an open form) in a query? The
code below is incorrect and opens the "Enter Parameter value" window.

Forms!MainForm!SubForm.Forms!ControlName

You almost had it:

Forms!MainForm!SubForm.Form!ControlName

SubForm.Form means 'the form hosted by the subform control'
 

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