Orderby Function

R

R

I have a address subform on a persons form. I want to order the addresses by
the type of address (ie. Primary, Work, Parents etc). I have a field "Type"
which specifies what address it is, which I would use for the Orderby, BUT I
want the PRIMARY addresses to be first on the list. Unfortunatly, I can't
just do a DESC order because there are address types such as work or Uncle.

Is there some way I can specify the first type to show...I don't even care
if everything after is alph or not. I just want the Primary address to be
the one that shows first.

I am up to coding it if I have to but I don't know where to even start.

Thanks for any suggestions in advance.
 
D

Douglas J. Steele

A common approach is to build a table that contains all the types of
addresses, along with a sort field (i.e. Primary would be 1, Business could
be 2, Parents could be 3 and so on). You'd join that table to your existing
table, and sort on the sort field.
 
K

KARL DEWEY

Create a Sort table with fields like this --
tblSort --
Type Sort
Primary 1
Work 2
Parents 3
etc 4

In your query join it to the Type field and add the Sort field to the grid
for sorting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top