View Full Version : E-mail notification when table is modified


kaveman
07-12-2004, 08:33 AM
I have a form I use to gather requests on certain issues. These requests go straight from the form into a table. Is there a way I can be notified by e-mail when someone has made a change to my table (ie. made a request) so I don't have to constantly check for requests? As always thanks in advance.

KenHigg
07-12-2004, 08:35 AM
Have you tried the SendObject method?

kaveman
07-12-2004, 08:37 AM
Not yet. I haven't because I am not familiar with how to use it. Any advice?

KenHigg
07-12-2004, 08:41 AM
The Visual Basic editor help would be a good place to start.

kaveman
07-16-2004, 10:57 AM
Here is the code I used:

DoCmd.SendObject acSendTable, "tbl W5", "(*.xls)", ("Kgallagher@gallagheruniform.com"), "", "", "New Softrak Request", "You have a new Softrak Request", False

It works fine. My new problem is I receive an error message from Outlook stating "A program is trying to send e-mail on your behalf. Do you want to allow this? If this is unexpected it could be a virus and you should choose no."

Any suggestions. The server I run on has a lot of security measures in place; could that be it?...or is it something simpler?

At any rate thanks for turning me on to the send object command. Once I can get this error out of the way these e-mails are going to help me a whole lot.

sonny
07-16-2004, 01:34 PM
I use this in a subform to send out emails.... I dont get that message, I used too, but not with this code.... I had to include "On Error Resume Next" in case someone closed the email without sending due to an error Outlook would do....
I believe a simple If/Then statement on the change in values of your controls could trigger the send mail portion... My email address gets filled in by whatever "Assigned_To.Column(1)" value is from my employee tables email column......

Private Sub Command20_Click()
On Error Resume Next
Dim daBody As String
daBody = ""
daBody = daBody & "UPC: " & Forms!frmMainData!UPC.Value & vbCrLf
daBody = daBody & "TASK: " & Tasks.Value & vbCrLf
daBody = daBody & "Start date: " & Assigned_Date.Value & vbCrLf
daBody = daBody & "Due date: " & Due_Date.Value & vbCrLf
daBody = daBody & "Assigned by: " & Assigned_By.Column(0) & vbCrLf
daBody = daBody & "Notes: " & NOTES.Value & vbCrLf

DoCmd.SendObject acSendNoObject, , , Assigned_To.Column(1), , , "New Assignment", daBody
End Sub

kaveman
07-20-2004, 11:34 AM
Thanks all for your help on this one. Now I don't have to constantly check my tables. :)