one-to-oneOrMore ?

C

Charlie

How can I enforce a relationship of "one to one or more"? In a tourism
business, a PARTY(lots of data) consists of one or more PASSENGERs(little
data). But, a PARTY must have at least one passenger.
TIA,
Charlie
 
B

Brian

Charlie said:
How can I enforce a relationship of "one to one or more"? In a tourism
business, a PARTY(lots of data) consists of one or more PASSENGERs(little
data). But, a PARTY must have at least one passenger.
TIA,
Charlie

I'm afraid you simply can't enforce this via relationships. You could
conceivably (and with difficulty) construct your user interface to enforce
this i.e. if someone enters a new party, then they must also enter a
passenger, and a passenger may not be deleted if it is the only passenger in
a party. However, as with any rule that relies entirely on the user
interface for it's enforcement, there is plenty of scope for it going wrong
or being circumvented, so it would be wise to incorporate some automatic,
periodic integrity checking in your system.
 
J

John Vinson

How can I enforce a relationship of "one to one or more"? In a tourism
business, a PARTY(lots of data) consists of one or more PASSENGERs(little
data). But, a PARTY must have at least one passenger.
TIA,
Charlie

You can't. At least temporarily as you're entering the data, you will
have to add a PARTY for there to be a record in the database to which
a PASSENGER record can be linked. It's a chicken-or-egg problem; you
must create one of the records first before the other, so you cannot
require that they both exist at all times.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Top