Sending email when a field data is changed

gsrajan

Registered User.
Local time
Today, 15:53
Joined
Apr 22, 2014
Messages
227
I have to send an email when the data is changed in a specific field ( for example, a field data is changed from "Pending" to "Paid".

Please let me know how to do this.

Thanks for your help.
 
if you are on data entry form, you can trigger the AfterUpdate of that specific field.

private sub yourFieldName_AfterUpdate()

If Me!yourFieldName.Value <> Me!yourFieldName.OldValue And _
Me!yourFieldName.OldValue & "" <> "" then
MsgBox "Status of field has changed from " & Me!yourFieldName.OldValue & _
" to " & Me!yourFieldName.Value
' do the rest of code, or email if you want
End If
End Sub
 
in field name AFTERUPDATE

DoCmd.SendObject acSendReport, "rptAlert", acFormatPDF, "name@aol.com", , , "field update", "Your field changed"
 

Users who are viewing this thread

Back
Top Bottom