Solved

reports in access

Posted on 2013-02-07
9
166 Views
Last Modified: 2013-02-08
Hello.
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.
0
Comment
Question by:PawloA
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 200 total points
ID: 38864153
(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.
0
 
LVL 1

Author Comment

by:PawloA
ID: 38864237
what if there are multiple tables in the source.ie. customer information and customer pricing where the relation is the customer ID and a field in the customer id is the check.?
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 200 total points
ID: 38864248
>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.
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 100 total points
ID: 38864297
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
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 200 total points
ID: 38864684
<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]
FALSE=No=0

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

JeffCoachman
0
 
LVL 1

Author Comment

by:PawloA
ID: 38865032
I often wonder the same thing on -1=Yes
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 200 total points
ID: 38865236
<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...
;-)

Jeff
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38868929
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...

...as always, you have the option of changing the points allocation...

;-)

JeffCoachman
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 38868934
Note to self:  Use Jeff's line <No Points wanted> to increase points.  

<chuckle>
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now