Unbound Report Text Box

P

Peter Nunez

I have a report based on a query that works fine,
rptDateCounts. I want to add a query to a unbound text box
in my page header to report a record count from a second
table. I have the query, that works, to do the counts. I
add it to the controlsource but it doesn't work. So, what
am I doing wrong?
 
M

Marshall Barton

Peter said:
I have a report based on a query that works fine,
rptDateCounts. I want to add a query to a unbound text box
in my page header to report a record count from a second
table. I have the query, that works, to do the counts. I
add it to the controlsource but it doesn't work. So, what
am I doing wrong?

Controls do not use SQL statements. You could use a DLookup
funtion to get the value from a predefined query:

=DLookup("fieldname", "queryname")

or something to that effect.

Alternatively, you could use VBA code to open a recordset to
retrieve the desired result.
 

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