adding another query to an existing report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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.
 
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?
 
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?
 
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?
 
Back
Top