Welcome to SPN

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

Sign Up Now!

Emailing from Access

Discussion in 'Information Technology' started by Matt W., Nov 17, 2005.

  1. Matt W.

    Matt W.
    Expand Collapse
    Guest

    I have a question about Access that I was hoping someone could help me with.
    I have a hyperlink on my form that when clicked, generates an email
    "mailto:mkhoffman@njm.com?Subject=ENROLL - Intro to Insurance". I also want
    to include in this email in the body, the first and last name of the person
    who's record is currently open by using the "lastname" and "firstname" fields
    on the form. Is this possible or is there another way of doing this?

    Example:
    I have the form open and I am looking at Joe Smith's Record. I click the
    hyperlink on the form and outlook opens with a preaddressed email with the
    subject and in the body of the email states "Please Enroll Joe Smith in Intro
    to Insurance". Basically, the person using the form will just have to open
    the record they want to look at, then just click the link, then send. Any
    help you can give me would be greatly appreciated.
     
  2. Loading...


  3. SusanV

    SusanV
    Expand Collapse
    Guest

    Hi Matt,

    Instead of using a Hyperlink, use the SendObject method - then you can
    define the body of the email as well as the subject line and TO address:

    http://www.blueclaw-db.com/docmd_sendobject_example.htm
    --
    hth,
    SusanV


    "Matt W." <MattW@discussions.microsoft.com> wrote in message
    news:F2F5BFF3-5692-4CFF-9357-5B462DFC1BC4@microsoft.com...
    >
    > I have a question about Access that I was hoping someone could help me
    > with.
    > I have a hyperlink on my form that when clicked, generates an email
    > "mailto:mkhoffman@njm.com?Subject=ENROLL - Intro to Insurance". I also
    > want
    > to include in this email in the body, the first and last name of the
    > person
    > who's record is currently open by using the "lastname" and "firstname"
    > fields
    > on the form. Is this possible or is there another way of doing this?
    >
    > Example:
    > I have the form open and I am looking at Joe Smith's Record. I click the
    > hyperlink on the form and outlook opens with a preaddressed email with the
    > subject and in the body of the email states "Please Enroll Joe Smith in
    > Intro
    > to Insurance". Basically, the person using the form will just have to
    > open
    > the record they want to look at, then just click the link, then send.
    > Any
    > help you can give me would be greatly appreciated.
    >
    >
     
  4. ldiaz

    ldiaz
    Expand Collapse
    Guest

    I think that you need create a command Botton to send e-mail like this..
    ___________________________________________
    Private Sub mail_Click()

    On Error GoTo Err_mail_Click

    Dim stDocName As String
    Dim stdomail As String


    stDocName = "Orders" ' name of the report
    stdomail = Me![SupplierID].Column(2) 'where addressee is called
    DoCmd.SendObject acReport, stDocName, , stdomail, , , "Subjet bla,bla,",
    "Body text bla,bla"


    Exit_mail_Click:
    Exit Sub

    Err_mail_Click:
    MsgBox Err.Description
    Resume Exit_mail_Click

    End Sub







    "Matt W." wrote:

    >
    > I have a question about Access that I was hoping someone could help me with.
    > I have a hyperlink on my form that when clicked, generates an email
    > "mailto:mkhoffman@njm.com?Subject=ENROLL - Intro to Insurance". I also want
    > to include in this email in the body, the first and last name of the person
    > who's record is currently open by using the "lastname" and "firstname" fields
    > on the form. Is this possible or is there another way of doing this?
    >
    > Example:
    > I have the form open and I am looking at Joe Smith's Record. I click the
    > hyperlink on the form and outlook opens with a preaddressed email with the
    > subject and in the body of the email states "Please Enroll Joe Smith in Intro
    > to Insurance". Basically, the person using the form will just have to open
    > the record they want to look at, then just click the link, then send. Any
    > help you can give me would be greatly appreciated.
    >
    >
     
  5. Matt W.

    Matt W.
    Expand Collapse
    Guest

    Is it possible to include just certian fields from my form in the email?

    "SusanV" wrote:

    > Hi Matt,
    >
    > Instead of using a Hyperlink, use the SendObject method - then you can
    > define the body of the email as well as the subject line and TO address:
    >
    > http://www.blueclaw-db.com/docmd_sendobject_example.htm
    > --
    > hth,
    > SusanV
    >
    >
    > "Matt W." <MattW@discussions.microsoft.com> wrote in message
    > news:F2F5BFF3-5692-4CFF-9357-5B462DFC1BC4@microsoft.com...
    > >
    > > I have a question about Access that I was hoping someone could help me
    > > with.
    > > I have a hyperlink on my form that when clicked, generates an email
    > > "mailto:mkhoffman@njm.com?Subject=ENROLL - Intro to Insurance". I also
    > > want
    > > to include in this email in the body, the first and last name of the
    > > person
    > > who's record is currently open by using the "lastname" and "firstname"
    > > fields
    > > on the form. Is this possible or is there another way of doing this?
    > >
    > > Example:
    > > I have the form open and I am looking at Joe Smith's Record. I click the
    > > hyperlink on the form and outlook opens with a preaddressed email with the
    > > subject and in the body of the email states "Please Enroll Joe Smith in
    > > Intro
    > > to Insurance". Basically, the person using the form will just have to
    > > open
    > > the record they want to look at, then just click the link, then send.
    > > Any
    > > help you can give me would be greatly appreciated.
    > >
    > >

    >
    >
    >
     
  6. SusanV

    SusanV
    Expand Collapse
    Guest

    Sure! Create a button to send the email, then in properties of the button
    alter the code. For instance, if you have the control CustomerName and 2
    fields you want included in the body text, you would do something like this

    sub YourButton_OnCLick

    dim n as string
    dim f1 as string
    dim f2 as string
    dim msg as string

    n = me.CustomerName
    f1 = me.field1
    f2 = me.field2

    msg = "Hello " & n & ", " & vbCRLF & "Please call me regarding " & f1 & " as
    soon as possible. I would also like to discuss " & f2 & ". See the attached
    report for details." & vbCRLF & "Sincerely, John Doe"

    DoCmd.SendObject acSendReport, "YourReportName", acFormatRTF,
    "user@domain.com",,,"Please Call",msg

    End Sub

    Assuming Customer is JB and Field1 is Widgets and Field2 is Dongles, this
    would send the following email to user@domain.com, with the associated
    Report attached as Rich Text Format:

    ===========
    Hello JB,

    Please call me regarding Widgets as soon as possible. I would also like to
    discuss Dongles. See the attached report for details.
    Sincerely, John Doe
    ==========


    See the SendObject Method in VB help for more info and options on the
    syntax.

    --
    hth,
    SusanV




    "Matt W." <MattW@discussions.microsoft.com> wrote in message
    news:F08ADCD9-8646-4DA7-A0D1-9576449F6A90@microsoft.com...
    > Is it possible to include just certian fields from my form in the email?
    >
    > "SusanV" wrote:
    >
    >> Hi Matt,
    >>
    >> Instead of using a Hyperlink, use the SendObject method - then you can
    >> define the body of the email as well as the subject line and TO address:
    >>
    >> http://www.blueclaw-db.com/docmd_sendobject_example.htm
    >> --
    >> hth,
    >> SusanV
    >>
    >>
    >> "Matt W." <MattW@discussions.microsoft.com> wrote in message
    >> news:F2F5BFF3-5692-4CFF-9357-5B462DFC1BC4@microsoft.com...
    >> >
    >> > I have a question about Access that I was hoping someone could help me
    >> > with.
    >> > I have a hyperlink on my form that when clicked, generates an email
    >> > "mailto:mkhoffman@njm.com?Subject=ENROLL - Intro to Insurance". I also
    >> > want
    >> > to include in this email in the body, the first and last name of the
    >> > person
    >> > who's record is currently open by using the "lastname" and "firstname"
    >> > fields
    >> > on the form. Is this possible or is there another way of doing this?
    >> >
    >> > Example:
    >> > I have the form open and I am looking at Joe Smith's Record. I click
    >> > the
    >> > hyperlink on the form and outlook opens with a preaddressed email with
    >> > the
    >> > subject and in the body of the email states "Please Enroll Joe Smith in
    >> > Intro
    >> > to Insurance". Basically, the person using the form will just have to
    >> > open
    >> > the record they want to look at, then just click the link, then send.
    >> > Any
    >> > help you can give me would be greatly appreciated.
    >> >
    >> >

    >>
    >>
    >>
     

Share This Page