Use DLookup() to get the field from the query.
Explanation of how it works:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html
The article refers to a table, but you can put your query name where it
expects the name of the table.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> I'm quite new to VBA and Access, but I want to get the result of a
> select statement into a variable to be able to work with it.
> The select statement will return only one value.
mieke.lamair@gmail.com - 09 Jul 2007 14:21 GMT
Thank you very much, I found it