473,554 Members | 2,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set sort order in MS Access 2000 report

Hello,

I have a report with the Priority field is used as sort order and
grouping. The problem is the data in this Priority field if sorted in
ascending order is: High, Low, and Medium. How could I sort it as:
Low, Medium, High?

Any suggestion is greatly appreciated,
James
Nov 13 '05 #1
11 3877
James, Don't know how you can, but what you could do is base the report on a
query. In the query add the fields you want for your report then add the
below statement to the top row (Field:) of an empty column in you query grid
txtSort:
IIf([Priority]="Low",1,IIf ([Priority]="Medium",2,IIf ([Priority]="High",3)))

Now you can sort by this field either in the query or via the sorting and
grouping in the report.

Hope this helps!

Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
Hello,

I have a report with the Priority field is used as sort order and
grouping. The problem is the data in this Priority field if sorted in
ascending order is: High, Low, and Medium. How could I sort it as:
Low, Medium, High?

Any suggestion is greatly appreciated,
James

Nov 13 '05 #2
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com
Hello,

I have a report with the Priority field is used as sort order and
grouping. The problem is the data in this Priority field if sorted in
ascending order is: High, Low, and Medium. How could I sort it as:
Low, Medium, High?

Any suggestion is greatly appreciated,
James


You are sorting by a text field. Best to use a numeric code to represent
the levels with a lookup table to get the text, makes sorting much
easier.

eg.
1 High
2 Medium
3 Low
--
regards,

Bradley
Nov 13 '05 #3
"Reggie" <NoSpam_webmast er@NoSpam_smitt ysinet.com> wrote in message news:<i6******* *************@c omcast.com>...
James, Don't know how you can, but what you could do is base the report on a
query. In the query add the fields you want for your report then add the
below statement to the top row (Field:) of an empty column in you query grid
txtSort:
IIf([Priority]="Low",1,IIf ([Priority]="Medium",2,IIf ([Priority]="High",3)))

Now you can sort by this field either in the query or via the sorting and
grouping in the report.

Hope this helps!

Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
Hello,

I have a report with the Priority field is used as sort order and
grouping. The problem is the data in this Priority field if sorted in
ascending order is: High, Low, and Medium. How could I sort it as:
Low, Medium, High?

Any suggestion is greatly appreciated,
James


Thank you, Reggie.
Nov 13 '05 #4
"Bradley.-." <sp********@mai l.com> wrote in message news:<A3******* ************@ne ws-server.bigpond. net.au>...
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com
Hello,

I have a report with the Priority field is used as sort order and
grouping. The problem is the data in this Priority field if sorted in
ascending order is: High, Low, and Medium. How could I sort it as:
Low, Medium, High?

Any suggestion is greatly appreciated,
James


You are sorting by a text field. Best to use a numeric code to represent
the levels with a lookup table to get the text, makes sorting much
easier.

eg.
1 High
2 Medium
3 Low


I followed Reggie's suggestion (and also from Bradley, thank you).
One thing I did not mentioned before was I have another Name sort and
grouping over Priority. Which means Name is the main sort and
grouping, then Priority (I named it PriorityNum). For debugging
purpose, I put PriorityNum (numeric) in both detail line and also in
the grouping header.

Whenever I ran the report, it prompted as: "Enter parameter value:" in
the box title, and it asked for PriorityNum. I entered nothing. The
result I got was the Priority numeric printed correctly at the detail
line, but the grouping header (I put as = [PriorityNum]), it did not
break correctly. For example, it shows PriorityNum as 2 at the header
grouping, but in that detail group, it shows all 2, 1 and 3 mixed up.

Any other suggestions? Thank you in advance.
James
Nov 13 '05 #5
James, I believe that is because you are using a reserved word for your
field "Name". Change this to txtName or something else and see if this
doesn't fix your problem. If not post back!

--
Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
"Bradley.-." <sp********@mai l.com> wrote in message

news:<A3******* ************@ne ws-server.bigpond. net.au>...
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com
Hello,

I have a report with the Priority field is used as sort order and
grouping. The problem is the data in this Priority field if sorted in
ascending order is: High, Low, and Medium. How could I sort it as:
Low, Medium, High?

Any suggestion is greatly appreciated,
James


You are sorting by a text field. Best to use a numeric code to represent
the levels with a lookup table to get the text, makes sorting much
easier.

eg.
1 High
2 Medium
3 Low


I followed Reggie's suggestion (and also from Bradley, thank you).
One thing I did not mentioned before was I have another Name sort and
grouping over Priority. Which means Name is the main sort and
grouping, then Priority (I named it PriorityNum). For debugging
purpose, I put PriorityNum (numeric) in both detail line and also in
the grouping header.

Whenever I ran the report, it prompted as: "Enter parameter value:" in
the box title, and it asked for PriorityNum. I entered nothing. The
result I got was the Priority numeric printed correctly at the detail
line, but the grouping header (I put as = [PriorityNum]), it did not
break correctly. For example, it shows PriorityNum as 2 at the header
grouping, but in that detail group, it shows all 2, 1 and 3 mixed up.

Any other suggestions? Thank you in advance.
James

Nov 13 '05 #6
"Reggie" <NoSpam_webmast er@NoSpam_smitt ysinet.com> wrote in message news:<Rc******* *************@c omcast.com>...
James, I believe that is because you are using a reserved word for your
field "Name". Change this to txtName or something else and see if this
doesn't fix your problem. If not post back!

--
Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
"Bradley.-." <sp********@mai l.com> wrote in message

news:<A3******* ************@ne ws-server.bigpond. net.au>...
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com
> Hello,
>
> I have a report with the Priority field is used as sort order and
> grouping. The problem is the data in this Priority field if sorted in
> ascending order is: High, Low, and Medium. How could I sort it as:
> Low, Medium, High?
>
> Any suggestion is greatly appreciated,
> James

You are sorting by a text field. Best to use a numeric code to represent
the levels with a lookup table to get the text, makes sorting much
easier.

eg.
1 High
2 Medium
3 Low


I followed Reggie's suggestion (and also from Bradley, thank you).
One thing I did not mentioned before was I have another Name sort and
grouping over Priority. Which means Name is the main sort and
grouping, then Priority (I named it PriorityNum). For debugging
purpose, I put PriorityNum (numeric) in both detail line and also in
the grouping header.

Whenever I ran the report, it prompted as: "Enter parameter value:" in
the box title, and it asked for PriorityNum. I entered nothing. The
result I got was the Priority numeric printed correctly at the detail
line, but the grouping header (I put as = [PriorityNum]), it did not
break correctly. For example, it shows PriorityNum as 2 at the header
grouping, but in that detail group, it shows all 2, 1 and 3 mixed up.

Any other suggestions? Thank you in advance.
James


Reggie,

In my program, I used txtAssignee instead of Name. Sorry, for the
confusion in my email when I tried to make it simple by using Name
instead of the real field name. So, here is my layout is supposed to
look like:

1) First sort and grouping: txtAssignee : in header group 1.
2) Second sort and grouping: txtPriority = [PriorityNum]. This part
is in the header group 2.
PriorityNum = Your IIF statement that you gave me.

James
Nov 13 '05 #7
James, Open your sorting & grouping box. Now select the txtAssignee first
from the drop down list then the txtPriority or PriorityNum second. From
your post a I can't tell what the control is because of this statement
"txtPriorit y = [PriorityNum]". It sounds like you are trying to group by
[PriorityNum] in you sorting & grouping box, but that field doesn't exist in
your recordsource anymore because you renamed it to txtPriority in the
query. Hope this helps, if not post back!

1) First sort and grouping: txtAssignee : in header group 1.
2) Second sort and grouping: txtPriority = [PriorityNum]. This part
is in the header group 2.
PriorityNum = Your IIF statement that you gave me.

--
Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com... "Reggie" <NoSpam_webmast er@NoSpam_smitt ysinet.com> wrote in message

news:<Rc******* *************@c omcast.com>...
James, I believe that is because you are using a reserved word for your
field "Name". Change this to txtName or something else and see if this
doesn't fix your problem. If not post back!

--
Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
"Bradley.-." <sp********@mai l.com> wrote in message

news:<A3******* ************@ne ws-server.bigpond. net.au>...
> "James P." <ha*********@ya hoo.com> wrote in message
> news:f4******** *************** ***@posting.goo gle.com
> > Hello,
> >
> > I have a report with the Priority field is used as sort order and
> > grouping. The problem is the data in this Priority field if sorted in > > ascending order is: High, Low, and Medium. How could I sort it as: > > Low, Medium, High?
> >
> > Any suggestion is greatly appreciated,
> > James
>
> You are sorting by a text field. Best to use a numeric code to represent > the levels with a lookup table to get the text, makes sorting much
> easier.
>
> eg.
> 1 High
> 2 Medium
> 3 Low

I followed Reggie's suggestion (and also from Bradley, thank you).
One thing I did not mentioned before was I have another Name sort and
grouping over Priority. Which means Name is the main sort and
grouping, then Priority (I named it PriorityNum). For debugging
purpose, I put PriorityNum (numeric) in both detail line and also in
the grouping header.

Whenever I ran the report, it prompted as: "Enter parameter value:" in
the box title, and it asked for PriorityNum. I entered nothing. The
result I got was the Priority numeric printed correctly at the detail
line, but the grouping header (I put as = [PriorityNum]), it did not
break correctly. For example, it shows PriorityNum as 2 at the header
grouping, but in that detail group, it shows all 2, 1 and 3 mixed up.

Any other suggestions? Thank you in advance.
James


Reggie,

In my program, I used txtAssignee instead of Name. Sorry, for the
confusion in my email when I tried to make it simple by using Name
instead of the real field name. So, here is my layout is supposed to
look like:

1) First sort and grouping: txtAssignee : in header group 1.
2) Second sort and grouping: txtPriority = [PriorityNum]. This part
is in the header group 2.
PriorityNum = Your IIF statement that you gave me.

James

Nov 13 '05 #8
"Reggie" <NoSpam_webmast er@NoSpam_smitt ysinet.com> wrote in message news:<OL******* *************@c omcast.com>...
James, Open your sorting & grouping box. Now select the txtAssignee first
from the drop down list then the txtPriority or PriorityNum second. From
your post a I can't tell what the control is because of this statement
"txtPriorit y = [PriorityNum]". It sounds like you are trying to group by
[PriorityNum] in you sorting & grouping box, but that field doesn't exist in
your recordsource anymore because you renamed it to txtPriority in the
query. Hope this helps, if not post back!

1) First sort and grouping: txtAssignee : in header group 1.
2) Second sort and grouping: txtPriority = [PriorityNum]. This part
is in the header group 2.
PriorityNum = Your IIF statement that you gave me.

--
Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
"Reggie" <NoSpam_webmast er@NoSpam_smitt ysinet.com> wrote in message

news:<Rc******* *************@c omcast.com>...
James, I believe that is because you are using a reserved word for your
field "Name". Change this to txtName or something else and see if this
doesn't fix your problem. If not post back!

--
Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
> "Bradley.-." <sp********@mai l.com> wrote in message news:<A3******* ************@ne ws-server.bigpond. net.au>... > > "James P." <ha*********@ya hoo.com> wrote in message
> > news:f4******** *************** ***@posting.goo gle.com
> > > Hello,
> > >
> > > I have a report with the Priority field is used as sort order and
> > > grouping. The problem is the data in this Priority field if sorted in > > > ascending order is: High, Low, and Medium. How could I sort it as: > > > Low, Medium, High?
> > >
> > > Any suggestion is greatly appreciated,
> > > James
> >
> > You are sorting by a text field. Best to use a numeric code to represent > > the levels with a lookup table to get the text, makes sorting much
> > easier.
> >
> > eg.
> > 1 High
> > 2 Medium
> > 3 Low
>
> I followed Reggie's suggestion (and also from Bradley, thank you).
> One thing I did not mentioned before was I have another Name sort and
> grouping over Priority. Which means Name is the main sort and
> grouping, then Priority (I named it PriorityNum). For debugging
> purpose, I put PriorityNum (numeric) in both detail line and also in
> the grouping header.
>
> Whenever I ran the report, it prompted as: "Enter parameter value:" in
> the box title, and it asked for PriorityNum. I entered nothing. The
> result I got was the Priority numeric printed correctly at the detail
> line, but the grouping header (I put as = [PriorityNum]), it did not
> break correctly. For example, it shows PriorityNum as 2 at the header
> grouping, but in that detail group, it shows all 2, 1 and 3 mixed up.
>
> Any other suggestions? Thank you in advance.
> James


Reggie,

In my program, I used txtAssignee instead of Name. Sorry, for the
confusion in my email when I tried to make it simple by using Name
instead of the real field name. So, here is my layout is supposed to
look like:

1) First sort and grouping: txtAssignee : in header group 1.
2) Second sort and grouping: txtPriority = [PriorityNum]. This part
is in the header group 2.
PriorityNum = Your IIF statement that you gave me.

James


Reggie,

I used txtPriority as group header 2. It refers to PriorityNum in the
detail line. PriorityNum is defined with your IIF statement. Neither
PriorityNum nor TxtPriority shown in the dropdown list of Sorting &
Grouping. I guess because these two fields I defined it myself and
they are not part of the SQL table I used for the report.

Plus, it keeps asking me to enter value for txtPriority. I just
clicked Ok without entering any value and I still have the same
problem of mixed up priority number in my detail line.
James
Nov 13 '05 #9
James, Lets try this! It sounds like you are typing txtPriority =
[PriorityNum] on the second line of the sort/group box and these are both
unbound controls on your report. Instead of that Open your report and open
the sorting/grouping box. Remove what you have on the second line and type
in exactly what Is below (which is probably what you have the control source
of your unbound [PriorityNum] set to).

=IIf([Priority]="Low",1,IIf ([Priority]="Medium",2,IIf ([Priority]="High",3)))

This should do what you want. If you set this second sort/group to Group
Header=Yes you will see the statement above as the title for the header.

--
Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
"Reggie" <NoSpam_webmast er@NoSpam_smitt ysinet.com> wrote in message

news:<OL******* *************@c omcast.com>...
James, Open your sorting & grouping box. Now select the txtAssignee first from the drop down list then the txtPriority or PriorityNum second. From your post a I can't tell what the control is because of this statement
"txtPriorit y = [PriorityNum]". It sounds like you are trying to group by [PriorityNum] in you sorting & grouping box, but that field doesn't exist in your recordsource anymore because you renamed it to txtPriority in the
query. Hope this helps, if not post back!

1) First sort and grouping: txtAssignee : in header group 1.
2) Second sort and grouping: txtPriority = [PriorityNum]. This part
is in the header group 2.
PriorityNum = Your IIF statement that you gave me.

--
Reggie

----------
"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
"Reggie" <NoSpam_webmast er@NoSpam_smitt ysinet.com> wrote in message

news:<Rc******* *************@c omcast.com>...
> James, I believe that is because you are using a reserved word for your > field "Name". Change this to txtName or something else and see if this > doesn't fix your problem. If not post back!
>
> --
> Reggie
>
> ----------
> "James P." <ha*********@ya hoo.com> wrote in message
> news:f4******** *************** ***@posting.goo gle.com...
> > "Bradley.-." <sp********@mai l.com> wrote in message

news:<A3******* ************@ne ws-server.bigpond. net.au>...
> > > "James P." <ha*********@ya hoo.com> wrote in message
> > > news:f4******** *************** ***@posting.goo gle.com
> > > > Hello,
> > > >
> > > > I have a report with the Priority field is used as sort order and > > > > grouping. The problem is the data in this Priority field if

sorted in
> > > > ascending order is: High, Low, and Medium. How could I sort it
as:
> > > > Low, Medium, High?
> > > >
> > > > Any suggestion is greatly appreciated,
> > > > James
> > >
> > > You are sorting by a text field. Best to use a numeric code to

represent
> > > the levels with a lookup table to get the text, makes sorting

much > > > easier.
> > >
> > > eg.
> > > 1 High
> > > 2 Medium
> > > 3 Low
> >
> > I followed Reggie's suggestion (and also from Bradley, thank you).
> > One thing I did not mentioned before was I have another Name sort and > > grouping over Priority. Which means Name is the main sort and
> > grouping, then Priority (I named it PriorityNum). For debugging
> > purpose, I put PriorityNum (numeric) in both detail line and also in > > the grouping header.
> >
> > Whenever I ran the report, it prompted as: "Enter parameter value:" in > > the box title, and it asked for PriorityNum. I entered nothing. The > > result I got was the Priority numeric printed correctly at the detail > > line, but the grouping header (I put as = [PriorityNum]), it did not > > break correctly. For example, it shows PriorityNum as 2 at the header > > grouping, but in that detail group, it shows all 2, 1 and 3 mixed up. > >
> > Any other suggestions? Thank you in advance.
> > James

Reggie,

In my program, I used txtAssignee instead of Name. Sorry, for the
confusion in my email when I tried to make it simple by using Name
instead of the real field name. So, here is my layout is supposed to
look like:

1) First sort and grouping: txtAssignee : in header group 1.
2) Second sort and grouping: txtPriority = [PriorityNum]. This part
is in the header group 2.
PriorityNum = Your IIF statement that you gave me.

James


Reggie,

I used txtPriority as group header 2. It refers to PriorityNum in the
detail line. PriorityNum is defined with your IIF statement. Neither
PriorityNum nor TxtPriority shown in the dropdown list of Sorting &
Grouping. I guess because these two fields I defined it myself and
they are not part of the SQL table I used for the report.

Plus, it keeps asking me to enter value for txtPriority. I just
clicked Ok without entering any value and I still have the same
problem of mixed up priority number in my detail line.
James

Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
28256
by: Alpay Eno | last post by:
Hello all... I'm using asp to get records from an access database, very similar to the way datagrid would work. The title of each column in my table is a link that alternates the sort order between ascending and descending... my problem is that text WILL change its sort order just fine but nubers are not always in order. ie: if sort order is...
4
3702
by: Matt | last post by:
Hi all, We recently upsized two Microsoft Access Databases to SQL. We're using an ADP (2002) as the front end. All the conversion issues have been resolved, except for one: Whenever we insert a record into a table, the table isn't sorted by primary key like I would expect. Instead, the record can be found at the end of the table. This...
3
7071
by: Charles | last post by:
I am trying to add the ability for a user to change the order in which the elements are listed in a dropdown list box. Before I added the ListID field the dropdown list box order was controlled using the MotorhomeID. The problem I am having is that I don't know the best method for allowing people to make the ListID changes easily. ...
1
1942
by: Rene | last post by:
I have another post regarding this "attendance" report of mine...this one concerns one of my sub-reports. It loses its alphabetical sorting when inserted in the master report. When run separately, it's perfect. Once inserted and printed in the master report...the data is in a random order. Any suggestions?
5
6626
by: Terri | last post by:
The following query will give me the top ten states with the most callers. SELECT TOP 10 Count(Callers.CallerID) AS CountOfCallerID, Callers.State FROM Callers GROUP BY Callers.State ORDER BY Count(Callers.CallerID) DESC; How can I return the same result set, the top ten states, but sort the result set by state.
21
3178
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each column. Once the array elements are split, what is the best way to sort them? Thank you. //populate data object with data from xml file. //Data is a...
6
3361
by: Julian | last post by:
Hi, I am a very beginner in databases. I created a database table in Access 2003 and OOo 2.03 that includes name, address, postcode, phone numbers etc of our customers. I would like to sort customers by areas of London, UK by the first part of the postcode. The London postcodes are the form of E19 4PR, NW5U 4RT. So I would like to print a...
3
2553
by: HowHow | last post by:
I need to sort the "DateOfBirth" by the day (dd) regarless of month (mm)and year (yyyy). I have a query called q_DC_Client, in criteria, I am using this code below: Like "*" & "/" & !! & "/" & "*" I have a form called F_DC_Birthday with combo box called ComboBdayMonth. The combo takes information from T_Month table, where I only have two...
4
2912
by: HowHow | last post by:
Using Access 2000. I need to group the address by suburb then by street name in my report. Two major problems here: 1. Unit number has the word "Unit" before number 2. Semi detach house has "a" or "b" after number Examples of the addresses as below. Address 1 means the first line/field for users to key address in line one, Address 2 means...
0
7600
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7521
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8042
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7563
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
3560
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2020
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1134
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
841
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.