Current method for returning a SQL value

  • Thread starter Phillip Armitage
  • Start date
P

Phillip Armitage

I'm working on a form in which the value of a text box will be the sole
value returned by a QUERY string on a table in the same access database. The
query uses information from another text box as search criteria.

I've found that I can't use a SELECT string as a ControlSource value for the
Text box, so I'm going with VBA code.

No problem writing the SELECT string. Just need someone to quickly advise me
as to the current method for opening a connection to the current Access
database, executing the SELECT string and assigning the results to a
recordset object.

Thanks
 
K

Ken Snell \(MVP\)

Use DLookup function as the expression in the textbox's Control Source
property. See Help for more info about DLookup, which allows you to return a
single value from one field or a combination of fields from a table/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