[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

reports in access

Posted on 2013-02-07
9
Medium Priority
?
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 66

Assisted Solution

by:Jim Horn
Jim Horn earned 800 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 66

Assisted Solution

by:Jim Horn
Jim Horn earned 800 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
LVL 48

Assisted Solution

by:Dale Fye
Dale Fye earned 400 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 800 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 800 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 66

Expert Comment

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

<chuckle>
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

650 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