Filter SendObject Request

J

Jason Lopez

Below is the code that I have associated with a couple of buttons on a form
that I am using. The button in question is the
Form_Email_Send_Report_PackInfo at the bottom. This is what I would like to
do. Similar to the print procedure (Button_Report_Print_PackInfo), I would
like to filter the report that I open to the current record that is being
viewed. I don't need the extra records. Just the one. The help on the
coding does not show a [Where] section in the coding line. But is there a
way to add one where I am only sending the current record similar to
printing only the current record.

Here's the code:

Private Sub Button_Report_Print_PackInfo_Click()
On Error GoTo Err_Button_Report_Print_PackInfo_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PackInfo"

stLinkCriteria = "[FltPln_PackageNumber]=" & Me![FltPln_PackageNumber]

DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria
Exit_Button_Report_Print_PackInfo_Click:
Exit Sub

Err_Button_Report_Print_PackInfo_Click:
MsgBox Err.Description
Resume Exit_Button_Report_Print_PackInfo_Click

End Sub
Private Sub Form_Email_Send_Report_PackInfo_Click()
On Error GoTo Err_Form_Email_Send_Report_PackInfo_Click

Dim stDocName As String

DoCmd.SendObject acSendReport, "PackInfo", acFormatHTML, , "email goes
here", , "Package Information", "Review the following information in regards
to your upcoming flight.", 0


Exit_Form_Email_Send_Report_PackInfo_Cli:
Exit Sub

Err_Form_Email_Send_Report_PackInfo_Click:
MsgBox Err.Description
Resume Exit_Form_Email_Send_Report_PackInfo_Cli

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top