*Filtering within a report*

E

EmilyFirstCov

Hello. I think that this is an easy one, but I'm stumped. I have a couple
of reports. On one report I want to filter by the date. I want a box to pop
up when I click to open the report and then I can input the date that I want
to find. In the other case I want to search by an identification number and
only bring up the records for that id #.

How do I do this?

Emily
 
B

BruceM

Base the first report on a query that includes the table containing the data
in the report. In query design view set the Criteria for your date field to
something like:
[Enter a date]
Include the square brackets.

Similarly, for the other report set the Criteria for the ID_Number field to
something like:
[Enter ID number}
 
T

TedMi

On the Open event of your report, display an InputBox asking for the date.
Validate the entered string to ensure it's a date, then set the report's
Filter property to MyDateFld=DateFromInputBox (use names as appropriate).
Also set the FilterOn property to True. Then execute Me.Requery

Repeat for the ID# on the other report.
-TedMi
 
J

John B. Smotherman

If your reports are based on a query, it's easy to add this type of criteria.
For example, to filter by date, find the date column in your query and on the
criteria row enter something like [Report Date] - be sure to include the
square brackets. Now when you open the report you'll get a popup asking for
the Report Date parameter.

HTH
 
A

Armen Stein

Hello. I think that this is an easy one, but I'm stumped. I have a couple
of reports. On one report I want to filter by the date. I want a box to pop
up when I click to open the report and then I can input the date that I want
to find. In the other case I want to search by an identification number and
only bring up the records for that id #.

How do I do this?

Emily

Hi Emily,

The previous responses will work and they are very easy to implement,
but they'll give you a single unformatted textbox in which to type the
date or ID #.

If you would like to prompt for more than one criteria on the same
form, or format the form nicely, you can use an Access form that is
called from the report when it opens. I have an example posted at
www.JStreetTech.com/downloads - it's called Report Selection
Techniques. There's some coding involved, but it's certainly doable
if you want to learn it.

Hope this helps,

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 

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