adding another query to an existing report

E

ekennedy

I have are report based upon a query. I would like to add a textbox to my
existing report that is based upon a separate query. How can I do that?
 
O

Ofer Cohen

If the other query returns only one record, you can use in the ControlSource
of the text box

=DLookup("[FieldNameToReturn]","[QueryName]")

If you need to a different value from this query for each record in the
report, then add this query to the RecordSource of the report, and link both
queries by the appropriate field
 
D

Duane Hookom

You have several options:
-if the other query returns only and always one record, include the
"separate query" in your report's record source

-use a domain aggregate function such as DLookup("fieldName","[Separate
Query]")

-use a subreport based on the "separate query"

-use code in your report to grab the value and display it in your report.
 
M

Mary Z

This was extremely helpful. I have my Subreport in my main report. How do I
get that data to print in list form?

Thank you.
Mary

Duane Hookom said:
You have several options:
-if the other query returns only and always one record, include the
"separate query" in your report's record source

-use a domain aggregate function such as DLookup("fieldName","[Separate
Query]")

-use a subreport based on the "separate query"

-use code in your report to grab the value and display it in your report.
--
Duane Hookom
Microsoft Access MVP


ekennedy said:
I have are report based upon a query. I would like to add a textbox to my
existing report that is based upon a separate query. How can I do that?
 
D

Duane Hookom

In order for your subreport to display multiple records, you should:
1) make sure the subreport's control properties are set to Can Grow: Yes
2) make sure the main report's section can grow
3) make sure the subreport returns more than one row
4) set the Link Master/Child properties are correct

--
Duane Hookom
Microsoft Access MVP


Mary Z said:
This was extremely helpful. I have my Subreport in my main report. How do I
get that data to print in list form?

Thank you.
Mary

Duane Hookom said:
You have several options:
-if the other query returns only and always one record, include the
"separate query" in your report's record source

-use a domain aggregate function such as DLookup("fieldName","[Separate
Query]")

-use a subreport based on the "separate query"

-use code in your report to grab the value and display it in your report.
--
Duane Hookom
Microsoft Access MVP


ekennedy said:
I have are report based upon a query. I would like to add a textbox to my
existing report that is based upon a separate query. How can I do that?
 
M

Mary Z

That worked! Thank you! Mary

Duane Hookom said:
In order for your subreport to display multiple records, you should:
1) make sure the subreport's control properties are set to Can Grow: Yes
2) make sure the main report's section can grow
3) make sure the subreport returns more than one row
4) set the Link Master/Child properties are correct

--
Duane Hookom
Microsoft Access MVP


Mary Z said:
This was extremely helpful. I have my Subreport in my main report. How do I
get that data to print in list form?

Thank you.
Mary

Duane Hookom said:
You have several options:
-if the other query returns only and always one record, include the
"separate query" in your report's record source

-use a domain aggregate function such as DLookup("fieldName","[Separate
Query]")

-use a subreport based on the "separate query"

-use code in your report to grab the value and display it in your report.
--
Duane Hookom
Microsoft Access MVP


:

I have are report based upon a query. I would like to add a textbox to my
existing report that is based upon a separate query. How can I do that?
 

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