benk Posted August 18, 2006 Posted August 18, 2006 I have a contact manager db and I only want to display one address per person. Currently I have to run a script attached to a primary checkbox looping and setting any related address to non-primary. Is there a trick to doing this using a one-to-one relationship? Or another basic way without a script? Basically, if a person has three addresses and I set one to primary(1) all the others should be set to non-primary(0)
Mikhail Edoshin Posted August 19, 2006 Posted August 19, 2006 Store the identifier of the primary address in a field in the Contact table.
benk Posted August 19, 2006 Author Posted August 19, 2006 (edited) Hey Mikhail, This will work, and am using this technique in other places where addresses are hardcoded to display a certain type of address (ie work address in the business section)...as the primary address (ie...work, school, etc) is not hard coded I was hoping to not have to use a script to copy or set the field. Essentially this address can be any type of address, it just has a second identifier as being the primary address. The tricky part is when adding a new address or changing the primary address I want a bullet-proof way to make sure there is only one address set as the primary (preferrably without scripting) Edited August 19, 2006 by Guest
bruceR Posted August 19, 2006 Posted August 19, 2006 There can only be one if you follow the suggestion.
Recommended Posts
This topic is 6729 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now