Results 1 to 6 of 6
  1. #1
    DaveyJ is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    28

    Email form data

    Hi Guys ,

    hope some of the Guru's can help me out.

    I have a Access form in which I would like to be able to email using some of the form data for the recipient of the email. I am also trying to find out is there any way to populate the body of emails text with information from the form.



    i have used the sendobj macros but this emails he full form as an attachment. Hoping someone can point me in the right direction.

    thanks in advance.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    I don't use macros, but you can certainly use form values in VBA code. You'd build a string variable:

    strBody = "Dear " & Me.FirstNameField

    then use the variable in SendObject.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    DaveyJ is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    28
    thanks for the quick reply.

    below is what i've been able to do, how would i incorporate your suggestion to what i've got? or am i going about it the wrong way?

    Private Sub sendEmail_Click()
    DoCmd.SendObject acSendForm, "Frm_details", , _
    "me.field", "me.field2", , _
    "Subject:" & Me.subjectr, "Here the message text"
    End Sub

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    See if this works (I assume you don't actually want to send the form):

    DoCmd.SendObject , , , _
    me.field, me.field2, , _
    "Subject:" & Me.subjectr, "Here the message text"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    DaveyJ is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2010
    Posts
    28
    thanks

    this brings up the email with no attachment but doesn't populate the to: fields with the form data

    am i doing something wrong?

    apologies , i am very new to VB

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Regarding me.field, is "Field" the name of the control on the form with the email address in it? Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Collect Data via Email Form
    By sgilleland in forum Access
    Replies: 3
    Last Post: 05-17-2013, 04:34 PM
  2. collect data via email
    By aspen in forum Access
    Replies: 2
    Last Post: 04-26-2012, 03:21 AM
  3. Collect Data Through Email in Table Format
    By snadeemshaikh in forum Access
    Replies: 1
    Last Post: 08-03-2011, 12:31 AM
  4. Import Data from a Table in the Body of an Email
    By a1195423 in forum Import/Export Data
    Replies: 0
    Last Post: 03-24-2011, 01:55 PM
  5. Collecting data via email with drop downs
    By tlyons in forum Access
    Replies: 2
    Last Post: 01-19-2011, 10:34 AM

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