email upon entry

  • Thread starter Thread starter brigid
  • Start date Start date
There are a couple of ways to integrate email capability into Access;
however, I am uncertain as to what you mean when you say "when an entry is
made in a table". Access tables do not have triggers as do SQL Server and
other client-server tables. So, if you want this to happen when you are
working in a table, the answer is: No, you cannot do it.

The recommended method of editing data in tables or adding records to tables
is to use Forms. Forms have Events which operate in a similar manner to
triggers. For example, if you add a new record to a table via a form the
Form's AfterInsert event will fire when a new record is saved. You could
use the SendObject method mentioned below in the form's AfterInsert event to
send an email whenever a new record is added.

SendObject allows you to attach the data in a table, query, report or other
Access object and to select the format of the output, which can include
HTML. Or, if you do not need to send an object, you can use the argument,
acSendNoObject.

DoCmd.SendObject acSendNoObject, , , "(e-mail address removed)", ,
, "Subject", "Message"

In addition, one can send emails using Automation with Outlook. Automation
affords the developer more capability and control in creating emails than
does SendObject. There is sample code at the following links that can get
you started:

MSDN article on creating appointments, emails, etc., using Automation
http://tinyurl.com/2knwj

Q161088 Using Automation to Send a Microsoft Outlook Message
http://support.microsoft.com/?id=161088

HOW TO: Use Automation to Send a Microsoft Outlook Message using Access 2000
http://support.microsoft.com/?id=209948

ACC97: How to Use a Recordset to Send Outlook E-Mail to Multiple Recipients
http://support.microsoft.com/?id=318881

Also, have a look at Tony Toews' email page:

http://www.granite.ab.ca/access/email.htm
 
Back
Top