Filter Data in Report

D

Domenick

I have a report that contains a customer listing with phone numbers. I want
to filter out all of the customers who do NOT have a phone number. Do I need
to go back and run a query off of my table or is there a way to filter data
directly from the report designer?
 
M

Marshall Barton

Domenick said:
I have a report that contains a customer listing with phone numbers. I want
to filter out all of the customers who do NOT have a phone number. Do I need
to go back and run a query off of my table or is there a way to filter data
directly from the report designer?


Normally, a button on a form is used to open a report. In
this case, you can use the OpenReport method in the button's
Click event procedure to filter the report. The code in the
event procedure would look something like:

DoCmd.OpenReport "reportname",,,"phonefield Is Null"

If you do not use a form, then it will be necessary to use a
query to filter the data. This can be done most easily by
setting the report's RecordSource property to this kind of
SQL statement:

SELECT * FROM thetable WHERE phonefield Is Null
 

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