ukdane
03-13-2009, 12:38 PM
I have four tables.
tbl1, tbl2, tbl3, tbl4
tbl1 contains: ordernr (primary key), town
tbl2 contains: ordernr (primary key), country
the two primary keys here are joined in a relationship.
tbl3 contains: id (primary key), town, and countryid.
tbl4 contains: countryid (primary key), country.
I've created a query that lists:
tbl1:ordernr, tbl3:town, and tbl4:country
The relationship for the query is:
tbl1.destination=tbl3.town and tbl3.countryid=tbl4.countryid
And it all works beautifully :-)
Now, the observant amongst you will also have notices that on tbl2 there is a field called country.
Every time the user adds an ordernr to tbl1, the same nr is added to tbl2.
I want the query (or some code/macro) to automatically add the country to tbl2 based on town and ordernr on tbl1.
Can someone tell me how to achieve this please.
Thank you.
tbl1, tbl2, tbl3, tbl4
tbl1 contains: ordernr (primary key), town
tbl2 contains: ordernr (primary key), country
the two primary keys here are joined in a relationship.
tbl3 contains: id (primary key), town, and countryid.
tbl4 contains: countryid (primary key), country.
I've created a query that lists:
tbl1:ordernr, tbl3:town, and tbl4:country
The relationship for the query is:
tbl1.destination=tbl3.town and tbl3.countryid=tbl4.countryid
And it all works beautifully :-)
Now, the observant amongst you will also have notices that on tbl2 there is a field called country.
Every time the user adds an ordernr to tbl1, the same nr is added to tbl2.
I want the query (or some code/macro) to automatically add the country to tbl2 based on town and ordernr on tbl1.
Can someone tell me how to achieve this please.
Thank you.