Grouping Records in a Report

themanof83

Registered User.
Local time
Today, 11:52
Joined
May 1, 2008
Messages
73
Hi,

I have used the Sort and Grouping function in access to group records by a field in a table called 'Section', which can be 1a, 1b, 1c, 2a .... 5e etc. I have used the first value of the 'Section' to group them which works fine but I am getting something odd......
When I view the report the sections are not produced in alphabetical order, the following is typical of what I am getting:

Section
---------------------------------------------------------------
1d
1b
1c
1a

2b
2c
2a
2e
2d

3b
3a

4a
4b
4c

5e
5a
5d
-----------------------------------------------------------------

For some reason there all completely different there is no logical sorting of the groups.
Any ideas would be greatly recieved....

Thanks
 
Probably because you are sorting on the first character only or dont have a sort at all...

Make sure to add a sort order and/or make the sort on the complete field instead of the first character only.
 
Surely you can see my dilemma then....
I have Sections that can only be grouped by 1st character otherwise they are grouped individually i.e.

-----------------------
Section

1a

1b

1c

1d

etc.
---------------------------------------------------------

Which doesn't bode well for my group footers.....
I'm thinking that I'll let the report group them as it does then apply some VB to sort out the sorting part.

Any help on the VB part????
Thanks
 
Sections by its nature have to be sorted by the section headers, but the subdata can be sorted in a different way.

In your recordsource you probably have your 1 character column set in the order by... Simply add to that order by your 2 char column and you should be all set.
 
I think someone was asleep when they were teaching Access!!! Me!
I have now solved my problem purely by using the Sort and Grouping Dialog to group by first character and then in the Order By property for the form I have set 'Sections'

Excuse my lack of basic Access knowledge! Thanks guys.
 

Users who are viewing this thread

Back
Top Bottom