G
Graeme Williams
Is there a simple way in VBA to retrieve a single value from a table?
Suppose I have a table T with two fields, K (for key) and V (for value). I
want to execute a query:
SELECT V from T WHERE K = "something"
and return the value into a variable. It would be as though Docmd.RunSQL
was able to return a value.
I know how to create a recordset, open it, read a record and close the
recordset. I just wondered if there was an easier way.
Suppose I have a table T with two fields, K (for key) and V (for value). I
want to execute a query:
SELECT V from T WHERE K = "something"
and return the value into a variable. It would be as though Docmd.RunSQL
was able to return a value.
I know how to create a recordset, open it, read a record and close the
recordset. I just wondered if there was an easier way.