Solved

How to create multiple groups on Access report

Posted on 2016-11-17
5
28 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
  • 2
  • 2
5 Comments
 
LVL 35

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 35

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 7 34
sql statement - 9 24
Create report using crosstab query 11 29
how to auto-schedule a VBA code to be run in MS ACCESS periodically ? 14 28
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…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
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…

773 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