reports in access

I have a simple report to print out with customer information. A field in the table is a checked field as well. Question is what is the simplest way to print the report with only the checked field checked to YES.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Data DudeCommented:
(1)  Eyeball the table or query that's in the report's Record Source property.
(2)  Create a new query that goes like this...

SELECT * FROM {the table or query in (1)} WHERE some_field = True

(3)  Figure out if you want (2) to replace your report, or if you want to create a new report with (2) as it's Record Source, so you have both.
PawloAAuthor Commented:
what if there are multiple tables in the customer information and customer pricing where the relation is the customer ID and a field in the customer id is the check.?
Jim HornMicrosoft SQL Server Data DudeCommented:
>and a field in the customer id is the check.?
Please provide more details and an example of what you mean here.

I interpreted 'check' as a Yes/No field, where when presented as a checkbox on a form Yes is checked, and No is not checked.
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Dale FyeOwner, Developing Solutions LLCCommented:
Generally, I design all my reports to report all of the data, then I use the WHERE argument in the OpenReport method to limit which records actually are displayed in the report.  That would look like:

Private Sub cmd_Report_Selected

    'Generates report for only those records that are "selected"

    Docmd.OpenReport "rpt_ReportName",acViewPreview,,"[FieldName] = -1"

End Sub
Jeffrey CoachmanMIS LiasonCommented:
<No Points wanted>

To be more in line with Yes/No...
You can also use fyed's syntax like this:

Docmd.OpenReport "rpt_ReportName",acViewPreview,,"[FieldName] = TRUE"

In this way it becomes more "human-readable"...
TRUE=Yes=[Anything other than 0]

No real relevance here, only that people often wonder why -1=Yes in MS Access


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PawloAAuthor Commented:
I often wonder the same thing on -1=Yes
Jeffrey CoachmanMIS LiasonCommented:
<I often wonder the same thing on -1=Yes >
Yeeh, ... in SQL Server it is 1=True

This is why I listed the syntax as:
    TRUE=Yes=[Anything other than 0]
..So here even values like 14, -2.34, .057, ...etc
(basically anything other than Zero)
...will all evaluate to TRUE...

Only Zero (0) will evaluate to false...

But again, no points wanted for any of my posts here...

Jeffrey CoachmanMIS LiasonCommented:
As I stated, I really did not want any points...
Besides, I have learned a great deal from Jim and fyed.
...all I did was provide some background info... always, you have the option of changing the points allocation...


Jim HornMicrosoft SQL Server Data DudeCommented:
Note to self:  Use Jeff's line <No Points wanted> to increase points.  

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.