Email Notification with Record ID (1 Viewer)

randallst

Registered User.
Local time
Today, 09:15
Joined
Jan 28, 2015
Messages
64
Hi There,

I want to create a button on my form so that once I have entered results of an Audit into the form, I want to be able to press the button to send the manager an email stating the Audit Observation Record ID to action.

Is there a way of doing this? This would save a lot of admin if so :)

All the best
Stu
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:15
Joined
Aug 30, 2003
Messages
36,127
Simplest would probably be SendObject, using the form control containing the desired value.
 

randallst

Registered User.
Local time
Today, 09:15
Joined
Jan 28, 2015
Messages
64
Is there a way of it just entering the ID into an automated email, for example;

Dear Joe Bloggs,

Please note that an audit has been carried out. Please review Audit ID 99 and provide feedback where possible.

Kind Regards
John Smith
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:15
Joined
Aug 30, 2003
Messages
36,127
Yes, using a string variable that you later use with SendObject:

Variable = "Blah blah" & Me.TextboxName & vbCrLf & "more blah here"

vbCrLf adds a return.
 

randallst

Registered User.
Local time
Today, 09:15
Joined
Jan 28, 2015
Messages
64
I've never done something like this before so apologies for sounding stupid.
How would I write this and where?

I am guessing from what you have wrote about I need to write something along the lines of;

"Please note that an audit has been carried out. Please review Audit ID" & Me.ID & vbCRLf "and provide feedback before the Target Date of Closure."
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:15
Joined
Aug 30, 2003
Messages
36,127
Along the lines of:

Code:
Dim strBody as String

strBody = "Dear Joe Bloggs, " & vbCrLf & vbCrLf & "Please note..." & Me.ID & " more here"

DoCmd.SendObject acSendNoObject,"",,"blah@blah.com",,,"subject", strBody, True
 

Users who are viewing this thread

Top Bottom