Data from a subform into a query

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

Hello all:

I have a form with multiple tabs displaying subforms. I want to use
data from both my main form and a subform as the criteria for a query.
The result set for this query will be passed to a process to create
indvidualized letters.

How can I get the data from the subform into the query. I use the
Forms![Form Name].field1 construct to get the data from the main form.

TIA

Ken Halpern
 
It is easiest to use the Build criteria by right clicking in the criteria
box in the query grid or use this syntax:

Forms![Form Name]![SubformControlName].Form![FieldName]

Pay attention to the square brackets, dots, and bangs(!), and that you have
the name of the subform control on the form, which may, or may not, be the
same as the subform name.
 
Arvin:

Many thanks. I was able to successfully build the query using your
method, I am grateful to you for teaching me a new technique.

Ken



It is easiest to use the Build criteria by right clicking in the criteria
box in the query grid or use this syntax:

Forms![Form Name]![SubformControlName].Form![FieldName]

Pay attention to the square brackets, dots, and bangs(!), and that you have
the name of the subform control on the form, which may, or may not, be the
same as the subform name.
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com


Hello all:
I have a form with multiple tabs displaying subforms. I want to use
data from both my main form and a subform as the criteria for a query.
The result set for this query will be passed to a process to create
indvidualized letters.
How can I get the data from the subform into the query. I use the
Forms![Form Name].field1 construct to get the data from the main form.

Ken Halpern
 
Back
Top