Populate form box with result of query

  • Thread starter rfuscjr via AccessMonster.com
  • Start date
R

rfuscjr via AccessMonster.com

I am trying to set the value of a text box on a form to the result of a query
that will only ever yield one value. What type of control should I use and
what should I set the properties to. So far when I try to connect to a query
I get a : ?Name in the box when I open the form. Thanks!
 
D

Dale Fye

I would try setting the control source property of the text box to something
like:

ControlSource: = DLookup("FieldName", "QueryName")


--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
M

Marshall Barton

rfuscjr said:
I am trying to set the value of a text box on a form to the result of a query
that will only ever yield one value. What type of control should I use and
what should I set the properties to. So far when I try to connect to a query
I get a : ?Name in the box when I open the form. Thanks!


Try using the DLookup function in a text box expression:

=DLookup("thefield", "your query")
 

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