Hello Linda
> My two tables are Conductor and Consumer.
I detect that you are actually describing three different entities, though.
Pieces and Conductors are not the same thing, and each should be modelled
by a table.
> Conductor table - Primary key is Conductor number + Piece
This is what I mean: a single Conductor has lots of Pieces, so there should
be two tables --
Conductors(*ConductorNumber, Wattage, StartsFrom, ... etc)
Pieces(*ConductorNumber(FK), *PieceCode, StartMap, EndMap, ... etc)
These two are clearly in a one-to-many relationship. You said above
> As I
> said in my initial email, the consumers know their
> conductor but they don't know, or care, about the piece.
(actually the initial mail talked about Months and Years, but never mind!)
If _you_ care about which Piece the Consumer is connected to, then the
relationship should be between Consumers(ConductorID, PieceCode) and
Pieces. Otherwise, enforcing the relationship between Consumers and
Conductors is fine.
> Consumer table - Primary key is Consumer number. This
> table also contains a Conductor number field.
Yes, that is fine.
> Likewise, a conductor cannot be totally deleted unless
> there are no consumers tied to it. By "totally" I mean
> all pieces. So if I have three pieces, two of the pieces
> can be deleted without problem, but if I try to delete the
> last piece and there are consumers tied to it I should get
> an error.
Unfortunately, Access cannot do this for you, with the model you described
above. A "real" RDBMS has triggers that can check this kind of thing, but
not this one, I'm afraid. You will have to control this behind a form, and
make sure that nobody had access to table datasheets, or making their own
queries, etc.
If you do relate Consumers to Pieces to Conductors, though, this rule will
be enforced by normal FK integrity.
Hope that helps
Tim F