Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Emailing from Access to Outlook Error

Discussion in 'Information Technology' started by TB, Oct 28, 2005.

  1. TB

    TB
    Expand Collapse
    Guest

    I have a field for entering addresses in my database and I would like for a
    user to click on the e-mail address in the field and it opens Outlook. I
    used the following code for the OnClick Event Procedure:

    DoCmd.SendObject acSendNoObject, , , [E-MAIL]

    When I click on the e-mail address on my form, it will open Outlook but when
    I try to close the message I get a "Run-time error '2501': The SendObject
    action was canceled" and Microsoft Visual Basic opens for me to debug the
    code. How can correct this?

    TB
     
  2. Loading...


  3. rico

    rico
    Expand Collapse
    Guest

    You need to add in some error handleing code. Somthing like:

    On Error Goto Err_NameOfYourButton_Click

    DoCmd.SendObject acSendNoObject, , , [E-MAIL]

    Exit_NameOfYourButton_Click:
    Exit Sub

    Err_NameOfYourButton_Click:


    End Sub

    Leaving Err_Nameof yourbutton with nothing in it will stop the error message
    occuring. For some reason setwarnings off does not work in this case.

    HTH

    Rico


    "TB" wrote:

    > I have a field for entering addresses in my database and I would like for a
    > user to click on the e-mail address in the field and it opens Outlook. I
    > used the following code for the OnClick Event Procedure:
    >
    > DoCmd.SendObject acSendNoObject, , , [E-MAIL]
    >
    > When I click on the e-mail address on my form, it will open Outlook but when
    > I try to close the message I get a "Run-time error '2501': The SendObject
    > action was canceled" and Microsoft Visual Basic opens for me to debug the
    > code. How can correct this?
    >
    > TB
     
  4. TB

    TB
    Expand Collapse
    Guest

    It works. THANK YOU!!!!!

    "rico" wrote:

    > You need to add in some error handleing code. Somthing like:
    >
    > On Error Goto Err_NameOfYourButton_Click
    >
    > DoCmd.SendObject acSendNoObject, , , [E-MAIL]
    >
    > Exit_NameOfYourButton_Click:
    > Exit Sub
    >
    > Err_NameOfYourButton_Click:
    >
    >
    > End Sub
    >
    > Leaving Err_Nameof yourbutton with nothing in it will stop the error message
    > occuring. For some reason setwarnings off does not work in this case.
    >
    > HTH
    >
    > Rico
    >
    >
    > "TB" wrote:
    >
    > > I have a field for entering addresses in my database and I would like for a
    > > user to click on the e-mail address in the field and it opens Outlook. I
    > > used the following code for the OnClick Event Procedure:
    > >
    > > DoCmd.SendObject acSendNoObject, , , [E-MAIL]
    > >
    > > When I click on the e-mail address on my form, it will open Outlook but when
    > > I try to close the message I get a "Run-time error '2501': The SendObject
    > > action was canceled" and Microsoft Visual Basic opens for me to debug the
    > > code. How can correct this?
    > >
    > > TB
     
  5. SusanV

    SusanV
    Expand Collapse
    Guest

    Perhaps this article will help:

    http://support.microsoft.com/?kbid=260819


    --
    hth,
    SusanV

    "TB" <TB@discussions.microsoft.com> wrote in message
    news:8DA28961-6C49-433F-9C46-5682B48F2553@microsoft.com...
    >I have a field for entering addresses in my database and I would like for a
    > user to click on the e-mail address in the field and it opens Outlook. I
    > used the following code for the OnClick Event Procedure:
    >
    > DoCmd.SendObject acSendNoObject, , , [E-MAIL]
    >
    > When I click on the e-mail address on my form, it will open Outlook but
    > when
    > I try to close the message I get a "Run-time error '2501': The SendObject
    > action was canceled" and Microsoft Visual Basic opens for me to debug the
    > code. How can correct this?
    >
    > TB
     

Share This Page