Form with one field to be e-mailed upon update

kaveman

Registered User.
Local time
Today, 12:25
Joined
May 12, 2004
Messages
58
I am using a form for users to enter requests. Currently when a user enters a request an email is generated using the sendobject command and i send the whole table in .xls format as an attachment to my e-mail. I'd rather when a request is entered that an email is sent to me with only the newest request in the body of the email. How can I go about doing this? As always thans a bunch in advance.
 
I use this event on a command button on my form to email a report with a copy to "Joe Bloggs" on our internal email. RecordID is your unique record identifier, just create a report with your field on, change the names and it will work.


Private Sub cmdSendRpt_Click()
On Error GoTo Err_cmdSendRpt_Click
Dim stDocName As String
DoCmd.RunCommand acCmdSaveRecord
stDocName = "Your Report name here"

DoCmd.SendObject acSendReport, stDocName, acFormatRTF, , , "Bloggs, Joe", "Your Subject Here" & Me.RecordID
Screen.PreviousControl.SetFocus
DoCmd.FindNext

Exit_cmdSendRpt_Click:
Exit Sub

Err_cmdSendRpt_Click:

Resume Exit_cmdSendRpt_Click

End Sub
 
This works great!

This is exactly what I was looking for. Thanks for the help on this one.
 
Cheers. I'm no expert but it's nice to give back a little of what I've learned on this forum. :)
 
How would you send the report to different email addresses depending on what record you were on. I manage a group of people and the status of their individual projects and deadlines. I would like the email to be sent to the Project Manager of the specific project which is defined in a field. Do I just subsitute the field name instead of "Bloggs, Joe"?
 
Using the same example from the previous posts if you want to send the e-mail to different e-mail recipients you would change the Bloggs, Joe to this:

DoCmd.SendObject acSendReport, stDocName, acFormatRTF, , , Me.(field that stores the e-mail address), "Your Subject Here" & Me.RecordID
 

Users who are viewing this thread

Back
Top Bottom