Results 1 to 5 of 5
  1. #1
    PrettyMess is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2016
    Posts
    4

    Access 2010 - Using Macros to send an email from access to outlook

    Hi All,

    I have been asked to make my database send emails when a new record is added or a change is made to the 'mobex' I have managed to get it to record the information in another table but I cant get the email to send

    I also don't want it to alert the member of staff that an email is being sent

    I need to set this up in a macro to make management of this easier as I will not be maintaing this going forward



    If anyone could help it would be greatly appreciated

    I have input this data into the after insert command on my table:

    Code:
    setlocalvar name varBodyTitle
    expression = concat('HTML Style goes in here wont display right',[MobileNumber],"Update to Mobex",'<\h2>')
    
    setlocalvar name varBodyMain
    expression = concat("Look at asap",'',"The following mobex has changed from",[OldValue],"to",[NewValue],'')
    
    setlocalvar name varBodyEnd
    expression = concat('',"this message is sent from an unmonitored email address",'')
    
    sendemail
    
    To ="email address"
    cc
    bcc
    subject ="New Update"
    Body =concat([varBodyTitle],[varBodyMain],[varBodyEnd])
    Many Thanks in advance
    Paula
    Attached Thumbnails Attached Thumbnails code3.JPG  

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you're still working on this, I have never been able to get MS access to send an email without a triggered event (button click, etc) without doing a hell of a lot of extra coding which macros could not handle. I would suggest you do this with vba if you are going to set it up, regardless of whether you're going to be maintaining it or not, macros are much more limited than vba.

  3. #3
    bcmarshall is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    95
    There is a triggered event. According to the posting, she wants "to make my database send emails when a new record is added or a change is made to the 'mobex'". That's an AfterUpdate event for the form.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    We don't know if it's going to be triggered by a record update or whether there is some other event, for instance, an end of day report with all the changes instead of an email getting generated every time a change is made. Generating an email every time a record is touched might be a big overwhelming :P

  5. #5
    bcmarshall is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    95
    Absolutely true, but conditional statements can be created to limit when conditions allow the email to be sent. It's just a thought.

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

Similar Threads

  1. Replies: 15
    Last Post: 10-17-2015, 07:02 AM
  2. Replies: 3
    Last Post: 11-12-2014, 11:52 AM
  3. Replies: 5
    Last Post: 04-25-2013, 10:36 AM
  4. how to send email in access 2010
    By nickblitz in forum Access
    Replies: 3
    Last Post: 10-29-2012, 07:28 AM
  5. Send email from Access thru Outlook
    By ZMAN in forum Forms
    Replies: 2
    Last Post: 11-27-2010, 06:10 PM

Tags for this Thread

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