retreiving the value(s) of sql select statements

  • Thread starter Thread starter Count
  • Start date Start date
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 :-)
 
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.
 
Back
Top