Hi all ... i know this has probably been dredged up before but I am struggling with this and I need an urgent fix.
I am trying to email a single record in a report. But no matter what I have tried it always produces a report of all recordests. I just need it to send the report that is currently being viewed in a form.
my current code works but only for 'all recordsets'.
here it is:
Private Sub sendMail_Click()
On Error GoTo Err_sendMail_Click
Dim strWhere As String
Dim stDocName As String
strWhere = "fldID"
stDocName = "rptPrintRecord"
DoCmd.SendObject acReport, stDocName, , "", , , "Website Enquiry", "Please find the attached Website Enquiry for your attention."
Exit_sendMail_Click:
Exit Sub
Err_sendMail_Click:
MsgBox Err.Description
Resume Exit_sendMail_Click
End Sub
any further help would be greatly appreciated.
I am trying to email a single record in a report. But no matter what I have tried it always produces a report of all recordests. I just need it to send the report that is currently being viewed in a form.
my current code works but only for 'all recordsets'.
here it is:
Private Sub sendMail_Click()
On Error GoTo Err_sendMail_Click
Dim strWhere As String
Dim stDocName As String
strWhere = "fldID"
stDocName = "rptPrintRecord"
DoCmd.SendObject acReport, stDocName, , "", , , "Website Enquiry", "Please find the attached Website Enquiry for your attention."
Exit_sendMail_Click:
Exit Sub
Err_sendMail_Click:
MsgBox Err.Description
Resume Exit_sendMail_Click
End Sub
any further help would be greatly appreciated.