Assign query results to variable? (ACC97)

K

Kyle [EAS]

Hello! I've got a select query that returns a single field. Is it possible
for me to assign the result of this query to a variable? Something like
this:

var = query.query_result

Thanks!
 
D

Dirk Goldgar

Kyle said:
Hello! I've got a select query that returns a single field. Is it
possible for me to assign the result of this query to a variable?
Something like this:

var = query.query_result

Use DLookup. The first argument would be the name of the field returned
by the query, and the second argument would be the name of the query.
For example,

var = DLookup("ResultField", "MyQuery")
 

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