M
Max Moor
Hi All,
I have a union query, in Access 2002, that I'm using in a combo box to
get an "All" option. That part works fine.
The problem is that I want the choices in the box to be sorted by the
ID value. In the underlying table, the ID field is an Autonumber. There are
currently 12 records. The sort comes out:
1
10
11
12
2
3
4
....
instead of:
1
2
....
9
10
11
12
The SQL for the combo box follows:
SELECT tblPurchaseGroups.PurchaseGroupID, tblPurchaseGroups.PurchaseGroup
FROM tblPurchaseGroups
WHERE (tblPurchaseGroups.PurchaseGroupID <> 1)
UNION Select "All" as AllChoice, "All" as Bogus
FROM tblPurchaseGroups
ORDER BY tblPurchaseGroups.PurchaseGroupID;
So, why is the sort wrong? Does the union with "All" mess something
up? How can I make it right?
- Max
I have a union query, in Access 2002, that I'm using in a combo box to
get an "All" option. That part works fine.
The problem is that I want the choices in the box to be sorted by the
ID value. In the underlying table, the ID field is an Autonumber. There are
currently 12 records. The sort comes out:
1
10
11
12
2
3
4
....
instead of:
1
2
....
9
10
11
12
The SQL for the combo box follows:
SELECT tblPurchaseGroups.PurchaseGroupID, tblPurchaseGroups.PurchaseGroup
FROM tblPurchaseGroups
WHERE (tblPurchaseGroups.PurchaseGroupID <> 1)
UNION Select "All" as AllChoice, "All" as Bogus
FROM tblPurchaseGroups
ORDER BY tblPurchaseGroups.PurchaseGroupID;
So, why is the sort wrong? Does the union with "All" mess something
up? How can I make it right?
- Max