E
erick-flores
Hello all
I am calling a the function "Sync" from my form. This is the code in
the form:
Private Sub Email_send_report_Click()
On Error GoTo Err_Email_send_report_Click
Call Sync <================CALLING THE FUNCTION
=============STOP CODE HERE IF ERROR ON FUNCTION=================
Dim stDocName As String
If MsgBox("message.", vbYesNo, "Submit Report?") = vbYes Then
Me.CHECK = True
Me.Dirty = False
stDocName = "Expense Report"
DoCmd.SendObject acReport, stDocName, "snapshot format"
DoCmd.Close
Else
'do nothing
End If
End Sub
What I want is, IF the function has an error then STOP THE REST OF THE
CODE OF THE FORM.
How do I do this??? Whats happening is, I dont want the e-mail to be
sent if one of the criterias under my function are not met. It is
giving the error (of the function) but it still running the e-mail
code in the Form.
Any ideas???
Thanks in advance
I am calling a the function "Sync" from my form. This is the code in
the form:
Private Sub Email_send_report_Click()
On Error GoTo Err_Email_send_report_Click
Call Sync <================CALLING THE FUNCTION
=============STOP CODE HERE IF ERROR ON FUNCTION=================
Dim stDocName As String
If MsgBox("message.", vbYesNo, "Submit Report?") = vbYes Then
Me.CHECK = True
Me.Dirty = False
stDocName = "Expense Report"
DoCmd.SendObject acReport, stDocName, "snapshot format"
DoCmd.Close
Else
'do nothing
End If
End Sub
What I want is, IF the function has an error then STOP THE REST OF THE
CODE OF THE FORM.
How do I do this??? Whats happening is, I dont want the e-mail to be
sent if one of the criterias under my function are not met. It is
giving the error (of the function) but it still running the e-mail
code in the Form.
Any ideas???
Thanks in advance