View Full Version : CancelEvent problem


nando
11-07-2001, 12:19 AM
I have a total percentage field on a form which must always equal 100 when the user tries to close the form. I use the Unload event to trap the error, display a warning message and then use the CancelEvent command to stop the unload.
This works fine, except that after the warning MsgBox is displayed, the message 'You canceled the previous operation' appears .
How can I stop this message appearing, or is there a better way to trap the error?
Thanks.

The_Doc_Man
11-07-2001, 06:28 AM
Perhaps use the Form_BeforeUpdate event, which allows a cancel parameter so you don't have to use the more drastic CancelEvent operation?

I've never had to deal with the message you describe when I use the Cancel parameter of the BeforeUpdate event.