Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On Error GoTo errhandle
- Me.Filter = "CurrentDate= #" & Format(Me!CurrentDate, "yyyy-mm-dd") & "# and DiscoverTime= '" & Me!DiscoverTime & "' and TailNumber= '" & Me!TailNumber & "' and FleetID= '" & Me!FleetID & "'"
- Me.FilterOn = True
- DoCmd.SendObject acSendForm, "frmETIC", acFormatPDF, "brianna.cates@fedex.com", "", "", "Recovery Report", "Attached is the submitted Recovery Report"
- DoCmd.Close acForm, "frmETIC", acSaveNo
- DoCmd.OpenForm "frmETIC", acNormal, , , acFormEdit, acWindowNormal
- End If
- errhandle:
- If Err.Number <> 2501 Then
- MsgBox ("Email Cancelled")
- DoCmd.Close acForm, "frmETIC", acSaveNo
- DoCmd.OpenForm "frmETIC", acNormal, , , acFormEdit, acWindowNormal
- End If
- On Error GoTo errhandle
- 'Your If is missing here.
- Me.Filter = "CurrentDate= #" & Format(Me!CurrentDate, "yyyy-mm-dd") & "# and DiscoverTime= '" & _
- Me!DiscoverTime & "' and TailNumber= '" & Me!TailNumber & "' and FleetID= '" & Me!FleetID & "'"
- Me.FilterOn = True
- DoCmd.SendObject acSendForm, "frmETIC", acFormatPDF, "brianna.cates@fedex.com", "", "", "Recovery Report", "Attached is the submitted Recovery Report"
- DoCmd.Close acForm, "frmETIC", acSaveNo
- DoCmd.OpenForm "frmETIC", acNormal, , , acFormEdit, acWindowNormal
- End If
- exitErr:
- Exit Sub
- errhandle:
- If Err.Number = 2501 Then
- MsgBox ("Email Cancelled")
- DoCmd.Close acForm, "frmETIC", acSaveNo
- DoCmd.OpenForm "frmETIC", acNormal, , , acFormEdit, acWindowNormal
- Else
- MsgBox "Error (" & Err.Number & ") - " & Err.Description & " Occurred."
- End If
- Resume exitErr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement