Reports with filtered forms

  • Thread starter Thread starter peneirol
  • Start date Start date
P

peneirol

I've create a form in access that alows me to filter data from a table
with the access button "filter by form" or "filter by selection". But
now I'm trying to in the same form and with the filter active produce a
report base on the filtered data (dynamic). How can I do this ?
 
Peneirol,

In order to use the Filter argument of an OpenReport macro action, the
filter has to be saved as a query. This, in my opinion, makes
approaching a report via a "filter by form" process, impactical. My
preference would always be to base the report on a query anyway, and
use references to form controls, using syntax such as
[Forms]![NameOfYourForm]![NameOfControl]
in the criteria of the query.

- Steve Schapel, Microsoft Access MVP
 
Add a command button to the form to print an existing report using the
following code:

Private Sub Command349_Click()
DoCmd.OpenReport "Filter by Form Report", acViewPreview, , Me.Filter
End Sub


Steve Schapel said:
Peneirol,

In order to use the Filter argument of an OpenReport macro action, the
filter has to be saved as a query. This, in my opinion, makes
approaching a report via a "filter by form" process, impactical. My
preference would always be to base the report on a query anyway, and
use references to form controls, using syntax such as
[Forms]![NameOfYourForm]![NameOfControl]
in the criteria of the query.

- Steve Schapel, Microsoft Access MVP
 
Back
Top