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
2 1683
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: - 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
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: - 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
Sign in to post your reply or Sign up for a free account.
Similar topics
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,...
|
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 -...
|
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...
|
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:
...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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,...
|
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$) {
}
...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |