Access 2003. The situation is this: I have a "criteria selection form"
in which there are a many different criteria, mostly displayed as combo
and text boxes in which a user can enter stuff, click an associated
button and that criteria becomes part of the where clause of a select
statement. The selected criteria is stored on a hidden form and when
the user is ready to run their report(s), a button action goes through
the hidden form and builds a select statement.
For example, say buildings has a partial combo box list which shows:
PK (hidden) Bldg Name
1 Arts Building
2 Biology Building
6 Chemistry Building
8 Student Building
A user want to look at records from Chemistry and Arts, so the hidden
form "SQL WHERE STAEMENT" field would store values like this when Arts
was selected:
BLDG_PK = 1
Then, altered to look like this when Chemistry is selected:
BLDG_PK IN (1, 6)
And so on as more buildings may or may not be selected.
That's all well and good. However, along with the "SQL WHERE STAEMENT"
field, there's also a "CRITERIA DESCRIPTION" field. This adds the
Building Names so that the user sees a criteria view somewhere that is
also reproduced as a report header which lists the buildings selected.
I'm using a line break, vbcrlf, as a delimiter here. So if the user
selected in the same order as in the example, the "CRITERIA DESCRIPTION"
field will look like this:
Arts Building
Chemistry Building
But what if the user selects Chemistry first, then arts? What is stored
in the "CRITERIA DESCRIPTION" field will be:
Chemistry Building
Arts Building
What I am trying to figure out is how to sort this, alphabetically.
Any ideas or gentle/violent prods? And yes, I know I have to take care
of possible duplicates which is easy enough to do... 8)
Thanks very much in advance.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me