"else" condition

O

Omar

Thanks for taking your time to read and respond to my
question, I appreciate it.

How do I set a condition in a macro that allows me to set
a creteria that if none of the previous conditions are met
then show a message box. This condition would be like an
ELSE statement in C-Language.
THanks
 
S

Steve Schapel

Omar,

I regret to say that this is sometimes an awkward thing to do in a
macro.

Sometimes you can manage it by using the StopMacro action, for
example...

Condition Action
FirstCondition FirstAction
.... OtherFirstAction
.... StopMacro
2ndCondition 2ndAction
.... Other2ndAction
.... StopMacro
3rdAction
Other3rdAction

In this case the macro only ever reaches the stage of 3rdAction if
1stCondition and 2ndCondition are not met.

In other cases, you have to specifically enter the condition to
exclude the others. For example...
Condition1: a>b
Condition2: a>c
Condition3: a>d
Condition4: b>=a And c>=a And d>=a

- Steve Schapel, Microsoft Access MVP
 

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