There's a couple of ways to approach this.
The simplest is to use the filter applied to your form as the filter for the
report also. You open the report filtered in Print Preview, and you can then
email it as filtered.
Private Sub cmdSend_Click
Dim strWhere As String
If Me.FilterOn Then
strWhere = Me.Filter
End If
DoCmd.OpenReport "Report1", acViewPreview, , strWhere
DoCmd.SendObject ...
End Sub
A few things can go wrong there:
a) In Access 2002 and later, if the filter includes a combo box where the
display column is not the bound column, there will be strange names in the
filter string (typically "Lookup..."), so when you try to apply this to the
report, it doesn't work. The solution is to redesign the query you use as
the source for your report, using the same alias for the lookup table as
Access used in your filter.
b) Opening the report filtered in print preview and then hoping that the
same filter gets applied to the instance you output or sendobject from is a
bit dodgy. This is the kind of thing that could break in some versions of
Access, if Microsoft ever gets around to trying to fix the Filter so you can
actually manipulate multiple instances of a report independently as you do
with forms. For this reason, my preference would be to alter the
RecordSource of the report in its Open event so that it includes the filter,
rather than just hope it works.
HTH
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
"open a adobe file from a command button"