Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2013
    Posts
    7

    Email Automation from Form

    I'm trying to set up some simple email automation to save my warehouse employees from having to write the same email to different customers multiple times per day. When they email a customer the message tells the customer the shipment ID and then the weights and dimensions for each box within the shipment. An example of the text in the email (including formatting) would be:

    Shipment 4381358
    Box 1 - 12" x 12" x 16" (13 lbs)
    Box 2 - 16" x 18" x 18" (34 lbs)

    Shipment 4389524
    Box 1 - 8" x 8" x 8" (2 lbs)
    Box 2 - 8" x 8" x 8" (2 lbs)
    Box 3 - 12" x 12" x 16" (24 lbs)

    I have the macro written to send the message from Outlook, and now I'm trying to design the form/subform (I know that's a bit backwards, but I wanted to make sure I could figure out the email automation since I hadn't done that before).



    My question is, how should I store the data so that the structure makes sense, and then what is the best way to feed that to the Outlook message via VBA? I'm getting hung up on the variability of my data. Some orders will have only 1 shipment ID, whereas others will have up to 5. Some shipments will have 1 box, and others will have up to 100.

    Any and all suggestions are very much appreciated. I'm pretty seasoned with VBA in Excel, but Access is a new beast to me, so forgive my ignorance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Options:

    1. open report filtered to the customer data and use SendObject method to attach report as PDF to email

    2. open a recordset object in VBA and loop through records to build a string of the customer data that can be used as the email body
    this approach can also use SendObject or Outlook automation
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Aug 2013
    Posts
    7
    Thanks so much for the reply. I didn't even think about attaching the report as a PDF, but that seems like the best/easiest option in this situation. One more super newb question, just to make sure I'm on the right track:

    Should I store the Orders, Shipments, and Boxes all in separate tables with a one to many relationship between each (one order can have multiple shipments, and one shipment can have multiple boxes), or should I combine the shipments and boxes tables to avoid having my data too spread out?

    Thanks again for the help!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    I think normalization calls for separate tables. Data 'spread out' should not be a deciding factor.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Automation using a form and vba
    By hinkwale in forum Forms
    Replies: 2
    Last Post: 01-09-2015, 08:31 PM
  2. Access2010 - email automation (if not NULL)
    By MikeDub in forum Access
    Replies: 3
    Last Post: 12-18-2014, 07:34 PM
  3. Email automation run-time error 2147467259
    By goestejs in forum Access
    Replies: 6
    Last Post: 06-19-2014, 02:00 PM
  4. Automation Error from form
    By gemadan96 in forum Forms
    Replies: 5
    Last Post: 05-21-2014, 12:27 PM
  5. Form-Record Automation Problem
    By keatsy_040489 in forum Forms
    Replies: 2
    Last Post: 02-05-2012, 05:08 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