VBA to send Alert email

craigprice

Registered User.
Local time
Today, 22:20
Joined
Apr 8, 2013
Messages
44
I need a script to run a report "executive incidents" pulling data for only the current record you are viewing.

This needs to be emailed as a RTF with one person in the TO field, one in the CC field and a small body of text.

Ideally I would like the RTF to output in landscape if possible.

I cannot for the life of me work this out, anyone able to help?
 
I have yeah, but when I try introduct my WHERE function to look at the dates it seems to dislike it.
 
This is the code I tried;

Private Sub test_Click()
On Error GoTo Err_test_Click
Dim stDocName As String
Dim strWhere As String
stDocName = "Executive Incidents"
strWhere = "[Date] = " & Me.[Date]
DoCmd.SendObject acReport, stDocName
Exit_test_Click:
Exit Sub
Err_test_Click:
MsgBox Err.Description
Resume Exit_test_Click

End Sub

This is not pulling the single record either.
 

Users who are viewing this thread

Back
Top Bottom