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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display select query result in a text box 1

Status
Not open for further replies.

jrollins

MIS
May 7, 2003
24
US
I created a select query that produces the correct dataset when the query is run directly. I have a text box on a form to display the query results. I went into the ControlSource property in the text box and used Expression Builder to select the field within the query that I want to display. When I open the form, the text box contains #Name?. Is this not the right way to display query results in a control?
 
Hi!

Short answer: No.

Perhaps one of the Domain Aggregate functions might work in your situation, for instance:

[tt]=DLookup("[Field Name]", "[Table Name]", "[Some Field] = 'SomeText'")[/tt]

Table Name, could also be a query, the criteria part might be ommitted...

Look it up in help, or post back with table/query names...

HTH Roy-Vidar
 
use a list box this control is designed to show query results
 
DLookup worked! Tried a list box, used Expression Builder to select the field in the query that I want to display but when I opened the form the list box was blank.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top