Relationships

T

Tom

My file contains two tables, ONE and MANY. Both tables
includes fields Donor No, Last Name, and First Name.

The tables are linked, one to many, via Donor No.

When I enter the Donor No in an input form for MANY, I
want the Last Name and First name from ONE to
automatically show in the input form.

How?

Thank you

Tom
 
J

John Vinson

My file contains two tables, ONE and MANY. Both tables
includes fields Donor No, Last Name, and First Name.

Why are you storing the names redundantly in the Many side table? It's
not necessary and it's not good design. People change their names (on
marriage or for other reasons); storing the donor's name in the many
side table just wastes space and ensures that you'll have a much
harder time keeping your database up to date if a person does so.

Relational databases use the "Granmother's Pantry Principle": "A place
- ONE place! - for everything, everything in its place". Store the
name *once only*, in the Donor table; if you need to see it in
conjunction with information in the Donations table or any other
related table, use a Query joining the two tables on DonorID.
 
T

Tim Ferguson

My file contains two tables, ONE and MANY. Both tables
includes fields Donor No, Last Name, and First Name.

You are not giving away much information. Presumably ONE.LastName and
ONE.FirstName are the names of the donor, while MANY.LastName and
MANY.FirstName are the names of the lucky people the donor is giving money
to?
The tables are linked, one to many, via Donor No.

One Donor, many recipients is good. But you have not explained what the
Primary Key is for the MANY table.
When I enter the Donor No in an input form for MANY, I
want the Last Name and First name from ONE to
automatically show in the input form.

Why would you want to do that? Surely the donor is not giving money to
himself -- at least not as a default? Most of the time surely you would
want to put someone else's name in there.

If you want to see the Donor's name and address in relation to the
donations he or she has made, then the thing to do is join the tables in a
query.

Hope that helps


Tim F
 
T

TC

To add to the other answers, ONE and MANY are really not good names to use
for tables!

You should name each table to reflect the nature of that data that is stored
in that table.

If a table contains one row for each Donor, call it DONOR, or DONORS.

Many people use the common prefix tbl for tables, so maybe tblDONOR or
tblDONORS.

Or, get that shift key working, & try tblDonor or tblDonors!

You will not see any profesionnally designed systems with table names like
ONE and MANY.

Apart from anything else, what happens if you add a third table (perhaps
called THIRD!) hich has a one-to-many relationship with table ONE? Now
you'll have to rename ONE, to MANY !!

HTH,
TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top