Automatic E-mail triggered by change in value in Database

Shane_Mc

Refulgent Sesquipedalian
Local time
Today, 20:49
Joined
Jun 24, 2002
Messages
39
Hi all,

What I want to do is have my access database send an e-mail to a particular address every time a (numeric) value in a certain field falls below a predefined level. This doesn't have to be instantaneous.

I would imagine it would be necessary to write a query to return the records in which the value in the relevant field is below its predefined (or trigger level) and write a macro to run this query every hour, or every day or what ever we decide is necessary.

But do any of you know how to trigger access to send this (form letter style) e-mail based on the results of this query?

I'm not even sure if this is possible but any help in the matter would be greatly appreciated.

Best Regards
Shane :)
 
I would use the on_timer event on a form and set the timer to execute code every hour. You would have to experiment with the time delay though ( the value 4000 is equal to about 3 seconds I think).
To send the email you could use similar code that I posted in the modules forum
http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=30353

Use an If statement to determine if you value is lower than your flag value.
ie If FieldVal < MyVal Then
Run Code
Else Exit Sub

Hope this helps.
Kev.
 

Users who are viewing this thread

Back
Top Bottom