Solved

How to create multiple groups on Access report

Posted on 2016-11-17
5
37 Views
Last Modified: 2016-11-18
Hello all:

I am trying to create a report in Access 2010.  I have mutliple rows where one column either is 0 or 1.  What I would like to do is have a section or group of items where column1=0 and a group of items where column1 =1.  Then I can add separate headings and column names like the following:



Soda
Company       Flavor      Size
Pepsi              Cherry     12oz        
Coke               Grape      16oz

Food
Company       Item          Calories  
BK                      Whopper  1000
Mcd                   Nuggets    500    

So, my two groups are soda and food (0 or 1), columns are different based on group, and the data is displayed.

Any help on this would be greatly appreciated!
0
Comment
Question by:Juan Ocasio
[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
  • 2
  • 2
5 Comments
 
LVL 37

Expert Comment

by:PatHartman
ID: 41892166
If the data you are displaying is different use two subreports.  One for each type.
0
 
LVL 14

Author Comment

by:Juan Ocasio
ID: 41892193
Thanks PatHartman:

Two questions:  How do you create a subreport in access 2010 and can you use the same Report Record Source?

Thanks!
0
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 41892267
You are showing two different sets of data.  Why would you want to mush them into the same form?  There is nothing to be gained by having to manipulate bound column names and captions on the fly.

A subreport is simply a report that you place onto another report.  Create the two new subreports, then drag each on to the detail section of the primary report.  Make sure that the master/child links are set properly so that Access will keep the reports in sync.  If you have defined relationships in the relationship window, Access will use those to set the master/child links for you.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 41892522
You may add a column to query: S_F: IIf([col]"0","SODA","FOOD") and sort report on S_F
On group header format event, modify label captions:
    If S_F = "FOOD" Then
        col1.Caption = "Food1"
        col2.Caption = "Food2"
    Else
        col1.Caption = "Soda1"
        col2.Caption = "Soda2"
   End If
0
 
LVL 14

Author Closing Comment

by:Juan Ocasio
ID: 41893908
thank you PatHartman
0

Featured Post

Independent Software Vendors: 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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

691 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