Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. On Error GoTo errhandle
  2. Me.Filter = "CurrentDate= #" & Format(Me!CurrentDate, "yyyy-mm-dd") & "# and DiscoverTime= '" & Me!DiscoverTime & "' and TailNumber= '" & Me!TailNumber & "' and FleetID= '" & Me!FleetID & "'"
  3. Me.FilterOn = True
  4. DoCmd.SendObject acSendForm, "frmETIC", acFormatPDF, "brianna.cates@fedex.com", "", "", "Recovery Report", "Attached is the submitted Recovery Report"
  5.  
  6. DoCmd.Close acForm, "frmETIC", acSaveNo
  7. DoCmd.OpenForm "frmETIC", acNormal, , , acFormEdit, acWindowNormal
  8. End If
  9.  
  10. errhandle:
  11. If Err.Number <> 2501 Then
  12. MsgBox ("Email Cancelled")
  13. DoCmd.Close acForm, "frmETIC", acSaveNo
  14. DoCmd.OpenForm "frmETIC", acNormal, , , acFormEdit, acWindowNormal
  15. End If
  16.  
  17. On Error GoTo errhandle
  18. 'Your If is missing here.
  19. Me.Filter = "CurrentDate= #" & Format(Me!CurrentDate, "yyyy-mm-dd") & "# and DiscoverTime= '" & _
  20. Me!DiscoverTime & "' and TailNumber= '" & Me!TailNumber & "' and FleetID= '" & Me!FleetID & "'"
  21. Me.FilterOn = True
  22. DoCmd.SendObject acSendForm, "frmETIC", acFormatPDF, "brianna.cates@fedex.com", "", "", "Recovery Report", "Attached is the submitted Recovery Report"
  23.  
  24. DoCmd.Close acForm, "frmETIC", acSaveNo
  25. DoCmd.OpenForm "frmETIC", acNormal, , , acFormEdit, acWindowNormal
  26. End If
  27.  
  28. exitErr:
  29. Exit Sub
  30. errhandle:
  31. If Err.Number = 2501 Then
  32. MsgBox ("Email Cancelled")
  33. DoCmd.Close acForm, "frmETIC", acSaveNo
  34. DoCmd.OpenForm "frmETIC", acNormal, , , acFormEdit, acWindowNormal
  35. Else
  36. MsgBox "Error (" & Err.Number & ") - " & Err.Description & " Occurred."
  37. End If
  38. Resume exitErr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement