Data from a subform into a query

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
 
A

Arvin Meyer [MVP]

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.
 
K

Ken

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
 

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