Printing filtered data from form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a very simple form to keep track of training classes. I want to be
able to print out a list of people for the specific date that I filter on.
How do I do that? I have a preview button I have created on the forms page,
but it previews all the data I have in the database. I just want it to
preview for that specific criteria I filtered on, without having to create
several different reports.Could you please Help?
Thanks,
 
I have a very simple form to keep track of training classes. I want to be
able to print out a list of people for the specific date that I filter on.
How do I do that? I have a preview button I have created on the forms page,
but it previews all the data I have in the database. I just want it to
preview for that specific criteria I filtered on, without having to create
several different reports.Could you please Help?
Thanks,

I guess it depends upon 'how' you filter the data.
You might try:

DoCmd.OpenReport "ReportName",acViewPreview, , Me.Filter

Otherwise let us know what your filter is.
 
KRB,

There are several ways to do this. One way is to provide an unbound control
on your form for the date (or two for a beginning and end date). Then create
a report based on a query that uses the entered value (or values) as
criteria. The criteria specification syntax is:

=Forms![YourForm]![YourControl] (one specific date)
or
Between Forms![YourForm]![YourControl] AND
Forms![YourForm]![YourOtherControl]

Then either base the report on the query, or preferably use the optional
Filter By parameter of the OpenReport method:

DoCmd.OpenReport "Your Report", acViewNormal, "YourFilterQuery"

Hope that helps.
Sprinks
 
Back
Top