retreiving the value(s) of sql select statements

C

Count

How do i use the results of sql SELECT statement in my VBA
code? How do i retrieve them and assign them to
variables? The source is an ODBC table. Say, I have a
created a query, of which i want to retrieve the results
(one record). There are two fields in the query. I want
to assign the value in one field to a form field and
assign the value of the other field to another form
field. How do I do this?

Signed, Frustrated :)
 
D

Douglas J. Steele

You have to open a recordset and read the fields in the recordset.

Alternatively, if you've saved the SQL as a query, you can use DLookup with
the query name where you'd normally put the table.
 

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