Results 1 to 2 of 2
  1. #1
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76

    Access 2010 - Email auto populate the correct persons email address

    Hello All,

    I currently have a database set up with three basic forms:

    Form 1 = Main menu with options to go to Form 2 and Form 3

    Form 2 = Employee information form which includes email address

    Form 3 = Employee document upload form


    My goal is once the Employee is registered in Form 2 they can then upload a document in Form 3. When they upload this document and fill out other parameters Including their bosses name (which is captured as a record in Form 2) they click "Submit Form." I would like for this submit form button to populate an email that is updated to send to the selected "Bosses name"

    Currently on the Submit form button I have:

    Private Sub Submit_Record_Click()
    DoCmd.SendObject _


    , _
    , _
    , _
    "email .com", _ <-- this is what I want to autopopulate with the correct persons email (as well as their name below)
    , _
    , _
    "***A new Lab Report has been submitted for your review***", _
    "Bosses name," & vbCrLf & vbCrLf & vbCrLf & "Please log into the Report Database and review the latest pending report. If you have any questions please contact the sender." & vbCrLf & vbCrLf & "This is an automated response generated from Microsoft Access." & vbCrLf & vbCrLf & vbCrLf & "Sincerely," & vbCrLf & "ESBU Lab Report Database", _
    False


    DoCmd.Close


    End Sub

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Here is an example using DLookup to get the stored Email address;
    DoCmd.SendObject acSendNoObject, "FormTyp", acFormatHTML, [E Mail], , , , "This Email is being sent by" ,DLookUp("[EmailMessage]","tblCompany"), True, ""
    HTH

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

Similar Threads

  1. Replies: 22
    Last Post: 04-24-2014, 01:56 PM
  2. Replies: 1
    Last Post: 07-16-2013, 12:16 PM
  3. Send email to persons returned in a query
    By Remillard in forum Programming
    Replies: 2
    Last Post: 04-04-2013, 10:15 AM
  4. Replies: 1
    Last Post: 11-10-2012, 09:13 AM
  5. Replies: 13
    Last Post: 11-07-2012, 03:14 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