multiple queries in Access 2003 Reports

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

Guest

Is it possible to base a report on more than one query?
I have two text boxes, each based on a different query. I just used the
properties value of the text box and then the control source to put in the
two different queries. The first text box has the following:
=[Class6] & [Class5] & [Class4] & [Class3] & [Class2]
This text box is based on qryBreakdownOfClasses and works fine.

The second query has the following:
=[qryRequiredFootnotesClass]![Class1] and prompts me for a parameter value
when I run the report. If I run this query by itself it runs fine so I'm
assuming I've done something wrong in the report and I'm guessing it's that
you can't have two separate queries in one report. If I can't do that could
there possibly be a workaround? Thanks in advance for any help.
 
=[qryRequiredFootnotesClass]![Class1]

you can't reference a query object that way.
a report (like a form) can only have one RecordSource. if you can "combine"
the fields from the two queries into a third query, and base your report on
the third query, that would do it - but it may not be possible. another
option to get the [Class1] value from qryRequiredFootnotesClass would be to
use a DLookup() function in the textbox control, as

=DLookUp("[Class1]", "qryRequiredFootnotesClass")

note that if this control is in the detail section of the query, then the
function will run for each record, which may slow down the report
considerably.

hth
 
Thank you very much. The DLookup worked.

tina said:
=[qryRequiredFootnotesClass]![Class1]

you can't reference a query object that way.
a report (like a form) can only have one RecordSource. if you can "combine"
the fields from the two queries into a third query, and base your report on
the third query, that would do it - but it may not be possible. another
option to get the [Class1] value from qryRequiredFootnotesClass would be to
use a DLookup() function in the textbox control, as

=DLookUp("[Class1]", "qryRequiredFootnotesClass")

note that if this control is in the detail section of the query, then the
function will run for each record, which may slow down the report
considerably.

hth


Joanne said:
Is it possible to base a report on more than one query?
I have two text boxes, each based on a different query. I just used the
properties value of the text box and then the control source to put in the
two different queries. The first text box has the following:
=[Class6] & [Class5] & [Class4] & [Class3] & [Class2]
This text box is based on qryBreakdownOfClasses and works fine.

The second query has the following:
=[qryRequiredFootnotesClass]![Class1] and prompts me for a parameter value
when I run the report. If I run this query by itself it runs fine so I'm
assuming I've done something wrong in the report and I'm guessing it's that
you can't have two separate queries in one report. If I can't do that could
there possibly be a workaround? Thanks in advance for any help.
 
you're welcome :)


Joanne said:
Thank you very much. The DLookup worked.

tina said:
=[qryRequiredFootnotesClass]![Class1]

you can't reference a query object that way.
a report (like a form) can only have one RecordSource. if you can "combine"
the fields from the two queries into a third query, and base your report on
the third query, that would do it - but it may not be possible. another
option to get the [Class1] value from qryRequiredFootnotesClass would be to
use a DLookup() function in the textbox control, as

=DLookUp("[Class1]", "qryRequiredFootnotesClass")

note that if this control is in the detail section of the query, then the
function will run for each record, which may slow down the report
considerably.

hth


Joanne said:
Is it possible to base a report on more than one query?
I have two text boxes, each based on a different query. I just used the
properties value of the text box and then the control source to put in the
two different queries. The first text box has the following:
=[Class6] & [Class5] & [Class4] & [Class3] & [Class2]
This text box is based on qryBreakdownOfClasses and works fine.

The second query has the following:
=[qryRequiredFootnotesClass]![Class1] and prompts me for a parameter value
when I run the report. If I run this query by itself it runs fine so I'm
assuming I've done something wrong in the report and I'm guessing it's that
you can't have two separate queries in one report. If I can't do that could
there possibly be a workaround? Thanks in advance for any help.
 

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

Back
Top