SetWarning Macro

  • Thread starter Thread starter LC
  • Start date Start date
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
 
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
 
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




.
 
Back
Top