@MajP
More questions ...
First off, you have the formats incorrect in your example - I don't have a first name field and a last name field, I have a name field and the sort order sorts by last name.
Second, the W3 Schools says I can join SQL statements not queries, and says both statements have to have the same sort order.
Third - I used "Unassigned" for the discussion, but I really want "Unassigned" and "SPO" at the top of the drop down in that order.
This what I have:
A table that I'll call TblEmployees with several fields - one of which is "Names" and contains "Marshall Brooks", "Tom Baker", "Joe Smith", etc.
A query called qryEmployeeNames with the Names column sorted by last name.
The SQL for qryEmployeeNames would be:
SELECT tblEmployees.Names FROM tblEmployees ORDER BY
Trim$(Mid$(tblEmployees.Names, InStr(tblEmployees.Name, " ") + 1))
I'm going to make a new table called tblEmployeesOther with a field Names and values of "Unassigned" and "SPO"
Can I make a qryEmployeesOther and sort that descending and then join the two queries (And not sort them together)?
Questions since I haven't tested this ...
Can the row source field (on the Access Form, not a user form) be:
qryEmployeesOther UNION qryEmployees
Or can it be
Select statement for tbl Employees other UNION qryEmployees
Or does it need to be W3Schools format, which would be:
SELECT tblEmployees.Names FROM tblEmployees UNION SELECT tblEmployeesOther.Names FROM tblEmployeesOther ORDER BY
Trim$(Mid$(tblEmployees.Names, InStr(tblEmployees.Names, " ") + 1))
By an odd quirk - I am sorting after the space and "Unassigned" and "SPO" don't have a " ", so Instr(.Names, " ") returns 0 so I think the above will give me:
SPO
Unassigned
Tom Baker ...
To get the order correct, I think I can do something like (not sure how Numbers/Letters/Special Characters are sorted:
In the Other table:
Unassigned AAAAAAAAAAAAAAAAAAAA
SPO AAAAAAAAAAAAAAAAAAAB
Or simpler:
Unassigned 1
SPO 2
if it sorts numeral-alpha
And then my statement probably needs to be:
SELECT tblEmployees.Names FROM tblEmployees UNION SELECT Trim$(Left(tblEmployeesOther.Names, InStr(tblEmployees.Names, " "))) FROM tblEmployeesOther ORDER BY
Trim$(Mid$(tblEmployees.Names, InStr(tblEmployees.Names, " ") + 1))
To summarize:
Can I union two queries (with different sort orders), or does it have to be two SQL Statements, or does it have to be two SQL statements with the same sort order?