set text box value to result of query

  • Thread starter Thread starter CuriousMark
  • Start date Start date
C

CuriousMark

Using VBA, how do I set the value of a text box control on a form to the
result of a query that returns one value? I'm sure I knew this at one point,
but I can't remember and I can't figure it out again. I can do this with a
combo box by setting the RowSource property to the SQL statement, but I can't
figure out how to do it for a text box.
 
CuriousMark said:
Using VBA, how do I set the value of a text box control on a form to the
result of a query that returns one value? I'm sure I knew this at one
point,
but I can't remember and I can't figure it out again. I can do this with a
combo box by setting the RowSource property to the SQL statement, but I
can't
figure out how to do it for a text box.

Me.TextboxName = Dlookup("FieldName", "QueryName")
 

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

Back
Top