TextBox Control

R

ryguy7272

I am trying to add a TextBox to a Report. Basically, I want to display some
data from two queries on a report (without combining the queries into another
query). I added a TextBox, went to Properties, and tried to set the Control
Source by using the ellipses button. I chose the appropriate queries. None
of the TextBoxes display any data. Here is a sample of one of the Control
Properties:
=[zzzSalesRegion]![SalesRegion]

What am I doing wrong?


Thanks for the help,
Ryan---
 
J

Jeff Boyce

If you don't combine the queries into one query, I don't believe you can set
your record source to more than one in a single report.

That last part is the clue, however.

If you create one report that shows data from Query1, then create a second
report that shows data from Query2, then create a third report as a
"master/main report" and embed the other two as sub-reports, you should be
able to do what I interpreted you're asking to do...

Or maybe I misunderstood?!

Good luck.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

fredg

I am trying to add a TextBox to a Report. Basically, I want to display some
data from two queries on a report (without combining the queries into another
query). I added a TextBox, went to Properties, and tried to set the Control
Source by using the ellipses button. I chose the appropriate queries. None
of the TextBoxes display any data. Here is a sample of one of the Control
Properties:
=[zzzSalesRegion]![SalesRegion]

What am I doing wrong?

Thanks for the help,
Ryan---

you cannot use that syntax in an unbound control.
If the query returns just one record, you can use:
=DLookUp("[FieldName]","QueryName")

However if the query returns many records, then you must add criteria
(a Where clause) to the above in order to tell Access which record you
wish returned.
The actual syntax depends upon the datatype of the criteria field.

See VBA help
Where Clause + Restrict data to a subset of records
 
B

boblarson

Or to add to what Fred said, if your query is going to return more than one
value and you want all of the values, you should use a sub report.
--
Bob Larson
Access MVP
Access World Forums Administrator
Utter Access VIP

Tutorials at http://www.btabdevelopment.com

__________________________________
 

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