I want to create a combo box with, in order, Detached, Semi-detached,
Bungalow, Flat, Other but the choices KEEP appearing alphabetically. I would
be delighted to hear from someone who knows how the answer.
tina - 23 Apr 2005 12:58 GMT
assuming the combo box's RowSource is a query or SQL statement, one solution
would be to add a calculated field, using the Switch() function to number
the choices, as
Switch([MyFieldName] = "Detached", 1, [MyFieldName] = "Semi-detached", 2,
[MyFieldName] = "Bungalow", 3, [MyFieldName] = "Flat", 4, [MyFieldName] =
"Other", 5)
replace MyFieldName with the name of the field that holds the values
"Detached", etc. then sort Ascending on the calculated field.
hth
> I want to create a combo box with, in order, Detached, Semi-detached,
> Bungalow, Flat, Other but the choices KEEP appearing alphabetically. I would
> be delighted to hear from someone who knows how the answer.
CarolineMerryl - 24 Apr 2005 01:21 GMT
Tina,
Many thanks!
Caroline
> assuming the combo box's RowSource is a query or SQL statement, one solution
> would be to add a calculated field, using the Switch() function to number
[quoted text clipped - 13 lines]
> would
> > be delighted to hear from someone who knows how the answer.
Duane Hookom - 23 Apr 2005 16:17 GMT
If you want to see records in a particular order, you have to be able to
create an expression based on field values to sort. I would probably add a
field to your lookup table that identifies the order. If you don't want to
do that, you could create a sorting expression in the row source sql like;
SortOrder: Instr("DSBFO", Left([YourField],1)

Signature
Duane Hookom
MS Access MVP
>I want to create a combo box with, in order, Detached, Semi-detached,
> Bungalow, Flat, Other but the choices KEEP appearing alphabetically. I
> would
> be delighted to hear from someone who knows how the answer.
tina - 24 Apr 2005 11:28 GMT
i hoped somebody would post a better solution than that clunky Switch()
function. thanks Duane! <bows and smiles, accepts 2nd oar gratefully and
finds rowing much easier>
> If you want to see records in a particular order, you have to be able to
> create an expression based on field values to sort. I would probably add a
[quoted text clipped - 6 lines]
> > would
> > be delighted to hear from someone who knows how the answer.
Duane Hookom - 24 Apr 2005 16:50 GMT
I actually would add a field to the table since the order could be
maintained in data rather than an expression.
Thanx,
Duane Hookom
MS Access MVP
>i hoped somebody would post a better solution than that clunky Switch()
> function. thanks Duane! <bows and smiles, accepts 2nd oar gratefully and
[quoted text clipped - 15 lines]
>> > would
>> > be delighted to hear from someone who knows how the answer.