If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Orderby Function
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. |
#2
|
|||
|
|||
Orderby Function
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. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "R" wrote in message ... 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. |
#3
|
|||
|
|||
Orderby Function
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. -- Build a little, test a little. "R" wrote: 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. |
Thread Tools | |
Display Modes | |
|
|