Solved

reports in access

Posted on 2013-02-07
9
169 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

828 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