Results 1 to 2 of 2
  1. #1
    Join Date
    May 2014
    Posts
    35
    Provided Answers: 2

    Unanswered: Question about sending an email from a form

    Database has two tables (EmployeeTBL and TransportTBL). EmployeeTBL has the fields (Employee, Email, Phone). TransportTBL has the fields (ID, Date Created, Date Accepted, Date of Transport, Time of Transport, Staff 1, Staff 2, Staff 3).

    From (TransportFRM enters data into TranportTBL with all of the same fields. Staff 1, Staff 2 and Staff 3 are combo box that lets me select from EmployeeTBL field (Employee).

    What I need is to send an email to the email address of the Employees selected in Staff 1, Staff 2 and Staff 3.

    I have a command button on the form and I know that I will need an (onClick) Event procedure. need help with the code.

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    Code:
    sub button_click()
       if not Isnull(txtStaff1) then docmd.SendObject acSendReport ,"MyReport","acFormatPDF", txtStaff1,,,"subject","body"
       if not Isnull(txtStaff2) then docmd.SendObject acSendReport ,"MyReport","acFormatPDF", txtStaff2,,,"subject","body"
       if not Isnull(txtStaff3) then docmd.SendObject acSendReport ,"MyReport","acFormatPDF", txtStaff3,,,"subject","body"
    end sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •