msgbox conditions

  • Thread starter Thread starter Joanne
  • Start date Start date
J

Joanne

I have a msgbox in a macro whose condition is:

MsgBox("Do Another Package?",4+32+256)=256

If the user chooses the 'yes' button, I am trying to create an action
relating to the yes response:

vbyes=true then take an action

But I keep getting an error that ms access cannot locate the variable
vbyes, so I am guessing that I am not using proper syntax to get the
results I need.

Could someone please tell me how to apply a vbyes or vbno condition to
a macro?
Thanks a bunch
Joanne
 
Joanne,

The immediate answer to your question is "You can't".

Your condition expression of
MsgBox("Do Another Package?",4+32+256)=256
will never be true. The 256 within the MsgBox function refers to
defining which button is the default button, but this will never be the
result of the MsgBox. This MsgBox has Yes and No buttons, so the
outcome will only ever be Yes, the value of which is 6, or No, the value
of which is 7. Therefore, if you want the action to occur if the MsgBox
response is Yes, your Condition needs to be...
MsgBox("Do Another Package?",4+32+256)=6
 
Back
Top