Stop a Macro depending on a query

J

juan

Hello,
I have a macro and would like to know if its possible to
stop the macro depending on my criteria of a query. Here's
what the macro do:
1.Imports a file
2.openquery - if my query results Null values in the
criteria field, then I want the macro to stop. But if
there are no null values, then I want the macro to
continue.
I'm not sure if this can be done.
Please advise any info.
Appreciate it.
Thanks,

juan
 
S

Steve Schapel

Juan,

It is not totally clear to me what you mean "if my query results Null
values in the criteria field". If it means if there are any records
returned by the query where the value of a field named Criteria is Null,
then...
1. There is no need to actually use an OpenQuery action, you can just
leave this out.
2. Add a StopMacro action to the macro, and in the Condition column for
this action, put the equivalent of...
DCount("*","YourQuery","[Criteria] Is Null")>0
 

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