I hope someone can help me. I've found two different solutions in
various newsgroups, but neither seems to work.
Upon exiting a form, I want to check that one and only of the
underlying records has a yes/no field set to -1. If that condition is
not met, I provide an appropriate error message and cancel the closing
of the form, so the user can fix the problem. My problem is that in
addition to my message, access adds a message that says: "You
cancelled the previous operation."
I have tried using DoCmd.SetWarnings before and after the cancel event
It doesn't appear to have any effect. Then I found a posting that said
this was the result of error 2501, so I added a trap for that to the
OnError section, but that seems to have no effect either, including
the fact that I don't get any error number at all on the message box
that says "You cancelled the previous operation." So maybe this isn't
actually an error message? Anyway, my code is as below. I hope someone
can hope me remove the annoying extra message.
Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Err_Form_Unload