Based a report on the current filtered recordset

G

Guest

On my form I go to various controls and use the filter by and filter
excludingselection. Eventually getting a small number of records in my
current records set. I would like my reports to use only the current
filtered recordset. The filtering will always change.

How do I base a report on this everchanging filtered recordset.

thanks
 
A

Al Campagna

Eric,
Here's a method I used...
If the form is not filtered, return just the current form record. If it is filtered,
use the same filter as the form.
The ELSE is the part your interested in...
(use your own object names)

Private Sub Report_Open(Cancel As Integer)
If Forms!frmCustomers.FilterOn = False Then
Me.Filter = "CustID = Forms!frmCustomers!CustID"
Me.FilterOn = True
Else
Me.Filter = Forms!frmCustomers.Filter
Me.FilterOn = True
End If
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