Full Version: Data updated with link
UtterAccess Discussion Forums > Microsoft® Access > Access Automation
TeancumTBH
Hi, I'm not sure if this is where this question belongs, but it doesn't fit very well anywhere else. I have tblExports which is a link to an ODBC table that refreshes every 60 minutes. Is there a way to receive an e-mail from my Access db when certain fields in the linked table are updated? I started simple, so if you have any questions, please feel free to ask. I appreciate the help.
theDBguy
First question: How are the fields updated?
TeancumTBH
Easy answer - my IT department does it. :-)
I'm kidding, sort of. I know that's not the answer you're looking for. I don't know what is being done behind the scenes to update the information. Once an hour there is something that a programmer wrote that updates all fields in the table. I have that table linked to my Access db. I belive that the linked table is from an Oracle db.
theDBguy
The easiest way would be to have the same program that updates the fields to also send the email out. Assuming that that is not possible, are you concerned about knowing if a new record is added or if any field was updated?

For new records, you can query the RecordCount of the tables every so often and send the email when a difference is detected. For field updates, that would be a little harder. Please explain more.
TeancumTBH
I would need the field update functionality. It is a bill of lading field that is null until we ship an order. Once that happens, the bill of lading field is populated with a 13 digit number. What I'd like to do is have an e-mail generate based on when that field is populated.
theDBguy
Since I don't know how you're updating the field, I will give you an example of one way it could be done. I hope you will be able to use it.

In the AfterUpdate event of the control for the bill of lading, you can put something like this:

DoCmd.SendObject, acSendNoObject, , ,"ToAddy", "CcAddy", , "Item #" & Me.ItemID & " has been shipped.", "EmailBody", True

HTH
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.