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

How do you populate a text box with a query? 1

Status
Not open for further replies.

Xenos132

Technical User
Dec 12, 2004
43
CA
How do I get a query to populate a text box? I can have it populate a combo box or list box, I just can’t seam to figure out the txt box.

I have a query that populates several list boxes. I then run a email script that takes this data and emails it. The problem is I have to click on every box before I can email it, I am assuming a text box will solve my problem of having to click on each box.


 
A text box can have only one value. Both list boxes and combo boxes have Row Sources properties that can return many records.

To pull a single value from a query, you can use DLookup().

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Can you help me write it? I know the list box is

SELECT QueEmail.[Email Address] FROM QueEmail;

So would it be

=Dlookup(SELECT QueEmail.[Email Address] FROM QueEmail;)
 
Did you even check Help on the syntax?
=Dlookup("[Email Address]","QueEmail")
This expression will return one email address from the query. If you have multiple records in QueEmail then you will need to add a where clause to the DLookup().

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thank you, works perfectly. I have just picked up a book on VBA however at this point I don’t know Jack but I’m learning.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top