Cancel Event in Public Function?

Local time
Today, 05:33
Joined
Jun 27, 2007
Messages
246
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...
Code:
amdValid = true
    If Nz(vFrm.txtvalue, "") = "" Then
        MsgBox "Please Include a Dollar Value for this Record"
        amdValid = False
    End If

called in code...

Code:
Private Sub comSave_Click()
On Error GoTo Err_comSave_Click

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

I had realllllllly hoped DoCmd.CancelEvent would cancel the event. Is there a better way to cancel the action?
 
like.......EXIT SUB.
stupid noob.
stupid stupid noob.
can't you see you're good for nothing, you're soooo stupid!
 

Users who are viewing this thread

Back
Top Bottom