SyBeerianTyGRRRR
Technical User
Evening all,
Can anyone tell me how to adapt the following code to only send the report page/pages relevant to the currently visible record in my form. The code below unfortunately attaches the entire report of many pages in length and if possible i want to avoid this as it makes the e-mail message too large. I tried to point the code towards the primary key text box called [AddressID] in the hope that this would select only the current record, but this just enters the exact text "[AddressID] = 1" in the To box in Outlook. The code i currently have is as follows:
===========================================================
Private Sub MailReportbtn_Click()
On Error GoTo Err_MailReportbtn_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptPlmkrsInfSheet"
stLinkCriteria = "[AddressID] = " & Me.AddressID
DoCmd.SendObject acReport, stDocName, acFormatSNP, stLinkCriteria
Exit_MailReportbtn_Click:
Exit Sub
Err_MailReportbtn_Click:
MsgBox Err.Description
Resume Exit_MailReportbtn_Click
End Sub
===========================================================
Obviously "rptPlmkrsInfSheet" is the report in question. I have a text box on the form called [EmailAddress] that contains the e-mail address for the current record. I need to use Snapshot format because the report pages i am sending contain bitmap images that do not display in rtf or other formats.
Any assistance would be very gratefully received.
Thanks in advance......
Can anyone tell me how to adapt the following code to only send the report page/pages relevant to the currently visible record in my form. The code below unfortunately attaches the entire report of many pages in length and if possible i want to avoid this as it makes the e-mail message too large. I tried to point the code towards the primary key text box called [AddressID] in the hope that this would select only the current record, but this just enters the exact text "[AddressID] = 1" in the To box in Outlook. The code i currently have is as follows:
===========================================================
Private Sub MailReportbtn_Click()
On Error GoTo Err_MailReportbtn_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptPlmkrsInfSheet"
stLinkCriteria = "[AddressID] = " & Me.AddressID
DoCmd.SendObject acReport, stDocName, acFormatSNP, stLinkCriteria
Exit_MailReportbtn_Click:
Exit Sub
Err_MailReportbtn_Click:
MsgBox Err.Description
Resume Exit_MailReportbtn_Click
End Sub
===========================================================
Obviously "rptPlmkrsInfSheet" is the report in question. I have a text box on the form called [EmailAddress] that contains the e-mail address for the current record. I need to use Snapshot format because the report pages i am sending contain bitmap images that do not display in rtf or other formats.
Any assistance would be very gratefully received.
Thanks in advance......