Quote:
>All works well except if the user tries to cancel. The cancel will take
>place but an annoying message pops up saying "The setting you entered isn't
>valid for this property" or "The Run Command Action was cancelled."
[snip]
Quote:
>Does anyone have a suggestion on how I can cancel a save gracefully?
There are several strategies that you may want/need to use in combination,
including trapping errors at in the form's OnError event. (There are some
errors you can't trap there, though, as you no doubt have found out.) Here
is one crude tactic that relies on the SendKeys action. It has helped me in
non-production-quality apps. Ace programmers, please don't flame me for this
;-)
'test for dirty record
If Me.Dirty Then
strM = "You are in the midst of adding/editing this order. "
strM = strM & "Click OK to proceed without saving changes."
intR = MsgBox(strM, vbOKCancel, "Order Add/Edit in Progress")
If intR <> vbOK Then
GoTo Exiter
End If
End If
'If okay to abort,
'get rid of that damn pencil
SendKeys "{ESC}", True
SendKeys "{ESC}", True
'close the form or do whatever
Tony Scilipoti
****************
Applications Development Lead
Brigham Surgical Group
Brookline, Massachusetts USA