SetWarning Macro

L

LC

I am trying to set my form so that when a user makes a
change to the form and the user goes to close the form
without saving first, it will automatically ask the user
whether they would like to save their changes. Right now
if they choose close without choosing save first, the
form will automatically save the changes.
Any suggestions?

Thanks
LC
 
S

Steve Schapel

LC,

The SetWarnings macro is not applicable to this situation. It only
relates to the display of system messages, such as action query
confirmations.

Sounds like you need to put a macro on the form's BeforeUpdate event.
Use the CancelEvent macro action, and in the Condition column put
something like...
MsgBox("Save changes?",36,"Confirm")=7
and then in the Condition of the next macro design row, put
....
and in the action use RunCommand and in the Command argument put
Undo

I haven't tested this, but it looks right :)

- Steve Schapel, Microsoft Access MVP
 
L

LC

Thanks Steve, it helped.
-----Original Message-----
LC,

The SetWarnings macro is not applicable to this situation. It only
relates to the display of system messages, such as action query
confirmations.

Sounds like you need to put a macro on the form's BeforeUpdate event.
Use the CancelEvent macro action, and in the Condition column put
something like...
MsgBox("Save changes?",36,"Confirm")=7
and then in the Condition of the next macro design row, put
....
and in the action use RunCommand and in the Command argument put
Undo

I haven't tested this, but it looks right :)

- 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