473,385 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Different sort based on value in GroupLevel

18
I have a report grouped by a location field. In the detail section it shows several columns such as 1st name, last name, city, st, zip & company name. My user would like his report sorted based on the value of that location field. For example, if the location is "NE" then sort the detail by City but if the location is "SE" then sort the detail by Company, etc. Is this possible? I should also mention that the report shows all locations it's not just one location per report.

I'm using Access 2003.

TIA
Connie
Oct 14 '08 #1
2 1683
Stewart Ross
2,545 Expert Mod 2GB
Hi Connie. Sorry to say that it really isn't possible to change the sort order of a report from within it according to the value of a field the way that is suggested. Report ordering is 'hard coded' into the report's grouping and ordering (it is completely independent of the underlying order of the query on which it is based). Although it can be changed under programme control this is more at a global level for the whole report, not for part of one.

If it is essential to achieve this, I suggest that you take a slightly different approach and include a composite calculated field into your report's recordsource query, one which can be based on an IIF or the like:

Expand|Select|Wrap|Line Numbers
  1. SortField: IIF([Location] = "NE", [City], [Company] & [whatever] & [else is required])
then sort the report on that custom field. The end result, if you get the IIF structure correct, should be the custom sort order you seek, whilst actually sorting on one field in your report (plus any other grouping) without trying to vary it dynamically.

-Stewart
Oct 14 '08 #2
cpStar
18
Hi Connie. Sorry to say that it really isn't possible to change the sort order of a report from within it according to the value of a field the way that is suggested. Report ordering is 'hard coded' into the report's grouping and ordering (it is completely independent of the underlying order of the query on which it is based). Although it can be changed under programme control this is more at a global level for the whole report, not for part of one.

If it is essential to achieve this, I suggest that you take a slightly different approach and include a composite calculated field into your report's recordsource query, one which can be based on an IIF or the like:

Expand|Select|Wrap|Line Numbers
  1. SortField: IIF([Location] = "NE", [City], [Company] & [whatever] & [else is required])
then sort the report on that custom field. The end result, if you get the IIF structure correct, should be the custom sort order you seek, whilst actually sorting on one field in your report (plus any other grouping) without trying to vary it dynamically.

-Stewart

Thank you Stewart for your quick response. I really didn't think it was possible as I thought sorting a GroupLevel was based on the overall GroupLevel. However, I will try your suggestion & see if that works. I'll reply before the end of week & let you know.

Thanks again for your help!
Connie
Oct 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Diego Barros | last post by:
Hello, I was wondering if it was posibble to sort a map using the values and not the keys. Sorting on the keys (if they were strings, for example) is currently possible. What about, for example,...
8
by: Sebastian Kerekes | last post by:
Greetings, I'm developing an application that supports multiple languages. In my XSL I use variables to place the text where it belongs to. At the top of the document I include those variables -...
2
by: qazmlp | last post by:
I have got the following strings: 121721234567890 13 1217212345 129 Is it possible to do descending sort for these strings based on their numeric values? After sorting, they need to figure...
20
by: Xah Lee | last post by:
Sort a List Xah Lee, 200510 In this page, we show how to sort a list in Python & Perl and also discuss some math of sort. To sort a list in Python, use the “sort” method. For example: ...
1
by: arthur-e | last post by:
How can you select records based on more than one combo box - I have a combobox that selects records based on name (I'm sure this has been asked a thousand times - web site answer/link could be...
9
by: Mikhail Teterin | last post by:
Hello! I'd like to have a variable of a pointer-to-function type. The two possible values are of type (*)(FILE *) and (*)(void *). For example: getter = straight ? fgetc : gzgetc; nextchar...
4
by: Matt | last post by:
I have been searching all over the web for a way to sort a DataGridView based on the actual text being shown in a ComboBox column as opposed to the underlying value (an ID in this case). Can anyone...
14
by: william.hooper | last post by:
There is a longer article about this subject here: http://www.codeproject.com/useritems/SortedList_Bug.asp See the main article and the reply thread started by Robert Rohde. Alternatively look...
12
by: kumarboston | last post by:
Hi All, I am trying to sort a column based on the numerical value but it seems to me that perl sorts based on first value of the column. For example, some of the data in my file is 23, 5467, 21, 64,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.