Reports with filtered forms

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 ?
 
S

Steve Schapel

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
 
C

Con Giacomini

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
 

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