I have finally got "SendObject" to work but now have a filter problem.
I have a database set up that I generate orders and print them as a single
page report. I've set up a filter so that when I "onclick" the button it
simply prints the order I can see (ie if I've entered Order 0100 - it only
prints the one that is open in the form).
I want the command button to continue printing but to also send the single
page by e-mail. However, although the print is still only printing the one
report the e-mail is attaching all of them - I have about 250 orders and
they all get attached to an e-mail.
Another "would be nice" is to have the actual report format attached to the
e-mail instead of RTF (snapshot would be nice but I don't think it works
with SendObject)
Can any guru's look at the attached code and tell me what I am doing wrong.
Private Sub Command85_Click()
On Error GoTo Err_Command85_Click
Dim stDocName As String
Dim stFilter As String
stDocName = "RptSiteInstruction"
stFilter = "ID = Forms!FrmInstruction!ID"
DoCmd.OpenReport stDocName, acViewNormal, , stFilter
DoCmd.SendObject acSendReport, stDocName, acFormatRTF,
"ja**@email.address.au", , , "Subject Text", , True
Exit_Command85_Click:
Exit Sub
Err_Command85_Click:
MsgBox Err.Description
Resume Exit_Command85_Click
End Sub
--
John Taylor