Filter Problem

M

MAD101

I am trying to create a filter query for a report but iy does not filter the
results. I have a database with people that has to be updated 60 days from
their start date. I want a filter to filter out the people who have start
days were 60 days ago. I also need this in a report that will auto open when
the database is first opened. But, I only need the report to auto open if
there are people on the report.

Please help!!!!!
 
A

Allen Browne

Create a query like this:
SELECT Table1.*
FROM Table1
WHERE (StartDate < Date() - 60) AND (IsHandled = False);

(I've assumed you have a yes/no field called IsHandled, so you can check
this box once you have dealt with the people and no longer need to report
them.)

Save the query as (say) qryNewPeople.
Create a report based on this query.

Create a macro.
In the Action column, choose OpenReport.
Enter this into the Macro Conditions column:
Not IsNull(DLookup("PersonID", "qryNewPeople"))
Save the macro with the name AutoExec
 

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