Macro Condition

G

Guest

Can I use the results of a query as a condition in a macro?
Can I use it in code? If yes, how?

Thanks
 
A

Allen Browne

You cannot refer directly to the output of the query in the Condition of
your macro.

If there is just one field value that you want to know about, you could use
DLookup() to get that value from the query.

The Condition column of the macro would contain something like this:
IsNull(DLookup("MyField", "MyQuery"))

More info on DLookup():
http://members.iinet.net.au/~allenbrowne/casu-07.html
 
G

Guest

Thankyou
-----Original Message-----
You cannot refer directly to the output of the query in the Condition of
your macro.

If there is just one field value that you want to know about, you could use
DLookup() to get that value from the query.

The Condition column of the macro would contain something like this:
IsNull(DLookup("MyField", "MyQuery"))

More info on DLookup():
http://members.iinet.net.au/~allenbrowne/casu-07.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.




.
 

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