Unbound Report Text Box

  • Thread starter Thread starter Peter Nunez
  • Start date Start date
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?
 
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.
 
Back
Top