Jumat, 13 April 2012

[MS_AccessPros] Re: E-mail on Change

 

Dan

While this isn't impossible, does your boss realize how many emails he's going to get?

Use each form's AfterUpdate event to send an email using DoCmd.SendObject.

But I bet he changes his mind after just one week. This being my prediction, you should use a global constant Boolean to determine if the email should be turned on or off.

In a standart module, put this in the general declaration area:
Public Const gcbolSendEmail As Boolean = True

Now add this public Sub in the same module
Public Sub SendEmail()
If gcbolSendEmail = True Then
DoCmd.SendObject ObjectType:=acSendNoObject, _
To:="myBoss@myCompany.com", _
Subject:="Another update", _
Message:="Do you give up yet?", _
MessageEdit:=False
End If

End Sub

Then in each form's AfterUpdate event put this code:
Private Sub Form_AfterUpdate()
Call SendEmail
End Sub

Edit the code in SendEmail to match your boss's email address, the message, etc. so it reads the way you want it to.

When he starts yelling, "STOP THOSE BLASTED EMAILS!!!" you can set the global constant to False.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile/Bill.Mosca

--- In MS_Access_Professionals@yahoogroups.com, Dan Fielding <amessyguy@...> wrote:
>
> Is it possible to send an e-mail via Outlook to a specific user every time a record in a database has been changed, deleted, or updated?
>
> My boss would like to receive a simple notification that a change has been made.  The actual update/addition that took place isn't important, just the fact that there was an update/addition.
>
> I guess there are two types of procedures that might be possible here.  One would be an e-mail notification each time any change is made (possibly generating a lot of e-mail messages).  The other would be one e-mail no matter how many changes took place during that editing/updating session.  I think to make things easier I would prefer that the boss get one e-mail stating that changes have been made, regardless of how many changes there were.
>
> If this is too difficult, is there some other method you all use to do something similar that doesn't involve e-mail?
>
> Dan
>
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar