Generate e-mail using data in the table

  • Thread starter Thread starter sreejith
  • Start date Start date
S

sreejith

Hi everybody,

I need to generate an e-mail to a particular ID using the
data regarding the installation of new component. To be
more clear, whenever a new product is issued to the user
in the company or replaced with a new one, I will be
updating a table in access with the device IDand serial no
of the device and user ID. what i want is the program
should recognize when the table is being updated and
should generate an email to our purchase manager.

Please give me some guidelines regarding this

- Thanking you in anticipation
- Sreejith
 
What you require is a Trigger. Triggers are only available with
client/server databases such as the MSDE or SQL-Server. An Access MDB does
not have triggers and is therefore incapable of what you want.

You can, however, use a form event to send email when the form updates the
table. The easiest method is to use SendObject which is built right into
Access. You can also open an Outlook session, code for which is on my
website:

http://www.datastrat.com/Code/OutlookEmail.txt
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
JFrank Brock said:
Arvin,

If you use the sendobject method, how can you pass any arguments down to a
report that sendobject gererates so that the report is customized to the
person you are sending to from the database.

Frank

You can, create and mail one report at a time with SendObject. You would use
a form to pass the variables to the report. For multiples, I am not sure how
robust that solution would be as there is a bug in SendObject which under
certain conditions causes it to error out. I have used the code on my
website:

http://www.datastrat.com/Code/OutlookEmail.txt

with some slight modifications to mail about 800 newsletters which could be
emailed 1 at a time. In an effort to reduce viruses, Microsoft changed the
way Outlook works. If you use Windows 2000 or earlier with Outlook 2000 or
earlier, and you haven't updated your Service Packs, you can get it to work
with multiple emails. Newer viruses are no longer accessing Outlook now, so
Microsoft's code is not stopping anything other than the old ones, and, of
course, honest development efforts.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top