Conditional Step in a Macro

B

Beverly76

Using my switchboard, I would like to prevent users from running reports at
the same time as the underlying data tables are being updated. The way I
would like to prevent this is to include a step in my macro that checks a
data table value for a "STOP" command, before continuing to open queries or
reports.

Basically, the person updating the tables would click a button on a form
which would change the value of a table to keep other users from being able
to run the action macros, and uncheck the box after the update.

How do I add an "if/then" statement in a macro? How do I reference a
Table.Field value in a macro. If [STOP]![ACTION](row 1)="Y", open form
"PLEASE TRY AGAIN LATER", otherwise, open report X.
Sincerely,
Beverly76
 
S

Steve Schapel

Beverly,

You would use a Condition in the macro. It is not 100% clear to me what
you mean, but here is an example of a macro Condition statement:
DCount("*","YourTable","[Stop]=-1")=0

This will enable the macro action (e.g. OpenReport) if there are no
records in the table where the Stop field is Yes (assumes Stop is Yes/No
data type).
 

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