Can you help me with a send email macro? Access 2010

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Corwin Moyne
    New Member
    • Feb 2012
    • 37

    Can you help me with a send email macro? Access 2010

    I have built an after update macro that auto orders printing plates by using the sendemail macro when the stock is set to 0 by the user. The problem is, I need to add info from a related table to the body of the email but I cannot figure out how. It works fine when its only sending info from the table itself. How can I add a field from a related table?
  • PGAC
    New Member
    • Jun 2012
    • 7

    #2
    If you modify the form's recordsource to include the field from the related table, then add this as a field to the form you are using, you should be able to include it into your email.

    In you macro, update the Body field to:

    Code:
    ="your message" & Forms!FormName!FieldName & "your message"
    I have done something simliar in the past, emailing from a form used to manage contacts and used fields to populate the "To" on the email.

    Comment

    • Corwin Moyne
      New Member
      • Feb 2012
      • 37

      #3
      The after update macro is being triggered when the table updates though, not the form.

      Comment

      • PGAC
        New Member
        • Jun 2012
        • 7

        #4
        Why not use the EmailDatabaseOb ject macro command on the form's after update (just don't specify an object to send).

        Comment

        • Corwin Moyne
          New Member
          • Feb 2012
          • 37

          #5
          I have just tried your suggestion. I used the on close macro as I may need to change the qty on up to 7 items on a single form and I don't want to send an email for each item.

          The on close does not work either as it only re orders the first item on the list. Getting closer though.

          Comment

          Working...