Using Reports with multiple sources

D

Dhaval

I am creating a report. I have bound it to particular macro. However, I need
to create a textBox which takes its data from a separate source being a
query. I am not sure How to bound this textBox to this query ( which is
separate from the original Report source )

Any suggestions.
 
M

Mike

Use a dlookup function, Here is an example:

=DLookUp("SumOfTOTALHOURS","[842-2486]","SumOfTOTALHOURS > 0")
"SumOfTOTALHOURS" is the feild in the query.
"[842-2486]" is the name of the query.
"SumOfTOTALHOURS > 0" is an optional conditional statement.

Place this in the control source of the textbox.

the only drawback to this is that you must do this for each textbox you want
to display data from for a different source other than what your report is
based upon, I.E. if you need 30 textboxes displaying data from 30 queries or
different tables, the you must use the dlookup function in each textbox,
citing the different tables or queries.
Let me know if this works for you.
 
D

Dhaval

Thanks Mike.

It works and is helpful.

cheers,

dhaval

Mike said:
Use a dlookup function, Here is an example:

=DLookUp("SumOfTOTALHOURS","[842-2486]","SumOfTOTALHOURS > 0")
"SumOfTOTALHOURS" is the feild in the query.
"[842-2486]" is the name of the query.
"SumOfTOTALHOURS > 0" is an optional conditional statement.

Place this in the control source of the textbox.

the only drawback to this is that you must do this for each textbox you want
to display data from for a different source other than what your report is
based upon, I.E. if you need 30 textboxes displaying data from 30 queries or
different tables, the you must use the dlookup function in each textbox,
citing the different tables or queries.
Let me know if this works for you.

Dhaval said:
I am creating a report. I have bound it to particular macro. However, I need
to create a textBox which takes its data from a separate source being a
query. I am not sure How to bound this textBox to this query ( which is
separate from the original Report source )

Any suggestions.
 

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