Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Filter Records in Report based on "Yes/No'' field

1,017 views
Skip to first unread message

Dan Johnson

unread,
Mar 31, 1999, 3:00:00 AM3/31/99
to
Can someone recommend the best approach to filtering records on a report
based on a "Yes/No" value list field property. Meaning, I have a report
based on a table that I want to filter the records to be printed. The field
I need to use as the criteria is a "Yes/No" value list field in the same
table the report is based on. I need the report to only show the records
that have the "No" value selected. I have tried creating a simple query
where the criteria is set to "No" and put this in the report On Open
property, however with multiple records matching this criteria, I get an
expression error and the reports filter property seems to keep adding the
expression for each record filtered. Help is greatly appreciated!

Paige

unread,
Mar 31, 1999, 3:00:00 AM3/31/99
to
why did you put the query in the on open property? it should have just been
listed as the Record Source property.

I'm not exactly sure what you're trying to do. Are you Opening the report
and checking the box? or is the value already checked and you are filtering
off that?
If the latter then the record source of the report should take care of that,
just check for a 0 or "no" value in criteria of the query.

Dan Johnson <djo...@home.com> wrote in message
news:eK2S9Pze#GA.266@cppssbbsa03...

Richard Summers

unread,
Mar 31, 1999, 3:00:00 AM3/31/99
to
>expression error and the reports filter property seems to keep adding the
>expression for each record filtered. Help is greatly appreciated!
I am not sure waht you are doing here, so I'll assume that
it is a report based on a query with some sort of filtering.

Remove filtering from the report properties and code.
Also, let the query to return all records. You apply
a filter/search in VBA by passing the where clause
in the OpenReport method of DoCmd object.

To open the report from a button click use:-

Dim stDocName As String. stSQL
stDocName = "Report"
stSQL = '[Query].boolean=0'
DoCmd.OpenReport stDocName, acPreview, , stSQL

Best way to experiment using the above method is to
create a form and report that use the same query. (make
sure your table definition has the lookups defined). Use
the on form filter function of access to create the where
clause that you require in your report. You can preview
your results in the form itself.

to see the where clause + create the report use.

Dim stDocName As String
Msgbox Form.Filer
stDocName = "SPEC_CHANGES"
DoCmd.OpenReport stDocName, acPreview, , Form.Filter

Dan Johnson wrote in message ...

Robert Cooper

unread,
Apr 6, 1999, 3:00:00 AM4/6/99
to
Dan,

Instead of using Yes/No for your filter, try using "1" for yes and "0" for no.

Hope this helps

Robert Cooper

Randall Benson

unread,
Apr 7, 1999, 3:00:00 AM4/7/99
to
I thought it was -1 and 0

Robert Cooper <robert...@NOSPAMeasiwipes.demon.co.uk> wrote in message
news:3709EB9F...@NOSPAMeasiwipes.demon.co.uk...

s.tayl...@gmail.com

unread,
Jan 16, 2020, 9:19:23 AM1/16/20
to
On Wednesday, April 7, 1999 at 2:00:00 AM UTC-5, Randall Benson wrote:
>The correct answer is -1 for yes and 0 for no.
0 new messages