View Full Version : Cancel Event in Public Function?


thisisntwally
09-10-2007, 08:05 AM
I've finally got a validation rule going in a public function. sadly the msgbox's spring, but the rest of the code continues to run.

setting the function as boolean...
amdValid = true
If Nz(vFrm.txtvalue, "") = "" Then
MsgBox "Please Include a Dollar Value for this Record"
amdValid = False
End If

called in code...

Private Sub comSave_Click()
On Error GoTo Err_comSave_Click

If amdValid(Forms![Input Form]) = False Then DoCmd.CancelEvent

I had realllllllly hoped DoCmd.CancelEvent would cancel the event. Is there a better way to cancel the action?

thisisntwally
09-10-2007, 08:09 AM
like.......EXIT SUB.
stupid noob.
stupid stupid noob.
can't you see you're good for nothing, you're soooo stupid!