Results 1 to 4 of 4
  1. #1
    JHadley is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    2

    Email when new data added to table from excel

    Good Morning All,

    I have a few stores that don't use PC's and can only use webmail.com for email. I have an excel workbook that will automatically send emails in outlook when one of the sheets is updated, but my stores don't have that option. I in turn created a workbook that they could fill out and send, which really only updates an Access database on a shared network drive. This is great for tracking on my end, but I am now stuck trying to find a way to get the Access database to generate an email when the table is updated.

    The database is very simple. The excel document my stores use will automatically add a new row of data in the table "req". I attached a test database with the table set up like the one I use. If there is any possibility of making this happen I'd greatly appreciate the feedback.



    **EDIT** Just to clarify, I'd need the email to go the address in the newly updated row in the table, and the first 10 columns of data in that same row would need to populate in the body of the email.

    James
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Build a query that has all the info you want to email
    then the command would be:

    DoCmd.SendObject acSendQuery, "qsQuery", acFormatXLS, "name@aol.com", , , "Subject", "message"

  3. #3
    JHadley is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    2
    Thanks for the response. May I ask, how do you set this up to automatically email the newest row in the query to the email address in the Email field upon update? Wouldn't the code you offered only work if triggered manually?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Need code behind a form, possibly in the AfterUpdate event. Can send data as an attachment as shown by ranman but if this is just one record of data, consider:

    strMsg As String

    strMsg = "This is new data: " & Me!field1 & ", " & Me.field2

    DoCmd.SendObject , , , "address", , , "Subject", strMsg
    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. Replies: 9
    Last Post: 10-25-2014, 04:09 PM
  2. Replies: 1
    Last Post: 09-06-2012, 12:33 PM
  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. Replies: 3
    Last Post: 01-21-2010, 08:10 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