?
Solved

How to create multiple groups on Access report

Posted on 2016-11-17
5
Medium Priority
?
41 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 38

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 38

Accepted Solution

by:
PatHartman earned 2000 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: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

762 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