Date: 2008-11-01 09:09 pm (UTC)
spiffikins: (Default)
From: [personal profile] spiffikins
I don't know Access but this is the normalized table structure you would use.

Table: PARENT_AREA
Columns: Area_Id, Name
Contents:
1,Europe
2,Asia
3,North America

Table: COUNTRY
Columns: Country_Id, Name
Contents:
1,Ireland
2,Great Britain
3,China
4,Canada
5,US

Table: Area_Country
Columns: Area_id, Country_id
Contents:
1,1
1,2
2,3
3,4
3,5

On the form, when you select "Asia" from the Parent list, run the query
select Name from country, area_country
where country.country_id = area_country.country_id
and area_country.area_id = 2;

will bring back "China" in this example

pass in the area_id that you select.


*************

Given that you have a limited number of combinations, you could simplify it by building a single table

Table: LOCATION
Columns: Area, Country
Contents:
Europe, Ireland
Europe, Great Britain
Europe, France
Asia, China
North America, USA
North America, Canada

Same concept though - when you pick "Europe" from the parent list, you run a query:

select country from location where area = 'Europe';

and it will bring back Ireland, Great Britain, France


This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

stoutfellow: Joker (Default)
stoutfellow

April 2020

S M T W T F S
    1 2 34
5 6 789 1011
12 13 14 1516 17 18
19202122232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 29th, 2025 01:20 pm
Powered by Dreamwidth Studios