Can I notify bd admin when data is changed?

asiamisia

New member
Local time
Today, 07:17
Joined
Aug 6, 2004
Messages
9
I was thinking how to make a simple data change notification. For example when user inputs new/change data in the table how to notify the database admin. Is there an event that I can handle and send and email for admin afterwards ?

Joanna
 
sure....

Put an Event after update which will e-mail the system admin (you may have to hardcode the e-mail address in your coding).

You can find lots of article how to send e-mail on this forum.

Good Luck.
 
doran_doran said:
(you may have to hardcode the e-mail address in your coding).

I'd advise against that and keep a table of administrator(s) that you can refere to - even if it only holds one record.

Hardcoding it in would mean, if the administrator or their address changed then you'd have to fix the code, recompile, and redistribute it when having it in a table means you can just change the value of the record.
 
Ok I know how to send an email from access I have table with admin(s) emails so hardcoding is not a problem but how to get to know when the data is changed? It is only one field in database which, when changed, should rise emailing action. But how will I know it has changed. Make a copy of data base and compare whole data with the open one? Not very nice... Is there an event I can listen and handle?
 
On Form_BeforeUpdate() event place code something like this:
Dim ctl As Control
If Me.Dirty then
If ctl.OldValue<>ctl.Value then

.....you logic here(send both values in table or in e-mail)

End If
Else
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom