Results 1 to 4 of 4
  1. #1
    baronqueefington is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    32

    error handler help

    Hello,

    I have code which successfully creates an email collecting data from a single record. I now need to create an error handler for the error 2501, which occurs when a user cancels sending the email.

    Here is the code have been using:



    Private Sub Command81_Click()

    Dim stdocname As String
    Dim stEmail As String
    Dim stSubject As String
    Dim stbody As String

    stdocname = "frmSearch"

    stEmail = Me.Email_Address & ""


    stSubject = "test"

    stbody = ""


    DoCmd.SetWarnings False
    DoCmd.SendObject acSendNoObject, , , stEmail, stEmailcc, , stSubject, stbody, , False
    DoCmd.SetWarnings True


    End Sub


    I am new to error handling so will continue to read up on the error, but if anyone out there can provide some input I would be grateful.

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Bing: access vba cancel email error handler

    https://social.msdn.microsoft.com/Fo...orum=accessdev
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    baronqueefington is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    32
    Thank you!

    This is exactly what I was looking for.

    Thank you again!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 12-17-2014, 11:53 AM
  2. Need help with Error Handler
    By RingoStarr in forum Programming
    Replies: 5
    Last Post: 09-20-2013, 02:07 PM
  3. Access Form Requery (F5 on keyboard or reopening) handler?
    By superfury in forum Code Repository
    Replies: 0
    Last Post: 08-23-2013, 03:17 AM
  4. Simple Error Handler
    By Tim777 in forum Access
    Replies: 7
    Last Post: 11-16-2012, 06:23 PM
  5. Global Error Handler Issue
    By usmcgrunt in forum Programming
    Replies: 1
    Last Post: 11-02-2011, 08:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums