Solved

reports in access

Posted on 2013-02-07
9
168 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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
 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

831 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