Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page