Re: Marking addresses as preferred
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Thu, 3 Jan 2008 14:59:46 +0900
Matthew, an alternate approach might be to use a Priority field (Number) instead of the Preferred field (Yes/no.)
That way, the user can specify the not only the #1 address for the client, but other preferred addresses as well. If they have 2 that are both #1, your software assumes that either one is of equal priority, and so the user will be happy with either address returned.
This is very simple to implement, more flexible and informative, and moves responsiblity for sorting out the data from the developer to the user.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Matthew" <mappleNOSPAMPLEASE@xxxxxxxx> wrote in message
news:eqo7RHcTIHA.6060@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
Here's my structure:
tblClients
*ClientID
...
tblAddresses
*AddressID
...
tblClientAddresses
*ClientAddressID
ClientID
AddressID
Preferred (y/n)
I want to make sure that every client has no more than one preferred address. I've identified those with more than one preferred, and it's a small enough number that I can clean that up manually.
But what about clients who have one or more addresses, but none are marked as preferred? How can I make sure that each unique client in tblClientAddresses has at least one (and preferably only one) of their addresses marked as Preferred?
Many thanks in advance!!
Matthew
.
- Follow-Ups:
- Re: Marking addresses as preferred
- From: Matthew
- Re: Marking addresses as preferred
- References:
- Marking addresses as preferred
- From: Matthew
- Marking addresses as preferred
- Prev by Date: Re: query for financial year
- Next by Date: Re: calculating an opening balance
- Previous by thread: Re: Marking addresses as preferred
- Next by thread: Re: Marking addresses as preferred
- Index(es):
Relevant Pages
|