I wrote a function that raises a MsgBox with OK and Cancel buttons. I need a condition in a macro stating if OK was pressed do this if Cancel is pressed do that.
In MS Access 2002 Help there is an example which doesn't work:
MsgBox("Confirm changes?",1)=1 that should carry out an action if OK is pressed and ignore it if Cancel is pressed. I have tried it but an error message was raised: "MyDatabaseName can't parse the expression MsgBox("Confirm changes?",1)=1".
Please learn the value of the messagebox options vbOK, vbOKCancel, vbAbortRetryCancel, vbDefaultButton1, ...
and vbOK, vbCancel, vbRetry, ... for the result codes.
This increases readability significantly (and reduces mistakes significantly too).
Try VB code. Are you using an event? Where are you placing the expression?
I believe macro's (not VB) also know the MsgBox function, but its different, because it only shows a message with only OK.