Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use text box's Control Source property to display query result?

Status
Not open for further replies.

sjh

Programmer
Oct 29, 2001
263
US
Hi,

My report is based on one query. But to display some information on the report header, I need to run a different query. Is it possible to use the text box's Control Source property to display the result of the query?

If there's no easy way, I guess I will have to execute a SQL statement in the VBA code.

Thank you!!
SJH
 
You can't put a SQL string in a control source however, you have several options:
1) Use DLookup() or other domain function
2) use a subreport based on the table/query
3) use code to grab the value and place it in the control
4) Add a query that returns only one record to the record source of the report
5) probably others...

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top