Solved

Grouping records in Access 2010 subform in Datasheet View

Posted on 2011-03-16
7
1,217 Views
Last Modified: 2012-05-11
I know this can be done, but I don't remember how:

I need to group records in a subform in datasheet view, so that records with the same value in the grouping field will be displayed as one with the 'plus' sign to expand the containing records.

I tried doing it by SQL group by in the recordsource property, but it doesn't work. Any ideas?
0
Comment
Question by:Hikarus
  • 4
  • 2
7 Comments
 
LVL 40

Expert Comment

by:als315
ID: 35146413
0
 
LVL 40

Expert Comment

by:als315
ID: 35146435
May be you can use pivot form?
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 35149196
Depending on the structure of your data, you may be able to do this with "Subdatasheets"
A Subdatasheet will allow you to expand/contract the related Child records of any one Parent record.

An example would be One customer with many Orders.
Create the two tables and relate them on CustomerID .

Then when you open the Parent table (Customers), the subdatasheet will appear (as a small black Plus symbol (+))
Clicking this small "+" will expand and contract the Child/Orders.

You can set up the same layout with what you are calling "groups" as long as the two tables are related on a common field.
ex.
tblColors
ColorID( PK)
ColorName

tblProducts
ProductID (PK)
ColorID (FK)
Price

Here , each "Color" would be what you are referring to as a "Group".
So in relating these two tables on ColorID, you will be able to open the Color Table and click the subdatasheet to see all the products with that color...

;-)

JeffCoachman
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 74

Expert Comment

by:Jeffrey Coachman
ID: 35149483
Or, ... use a Main/subform

Sample attached...

;-)

JeffCoachman
Database49.mdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35149516
The disadvantages of using SubDatasheets are:
1. They give your users direct, *Unlimited* access to the Raw table.
This means they can do whatever they like (Delete Record/Fields, change table properties, ...etc)
:-O

2. They are a drag on performance:
http://support.microsoft.com/kb/275085

0
 

Author Closing Comment

by:Hikarus
ID: 35155670
Thanks!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35157267
OK,

Did you note the disadvantages of using this approach...?
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

820 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