You should have the tables:
TblRegion
RegionID
Region
TblProvince
ProvinceID
RegionID
Province
TblLocation
LocationID
ProvinceID
Location
Code
To get the results you want, your dropdowm box should be based on a query
that includes all three tables. The fields in the query should be
LocationID, Location, Code, Province and Region. Set the Bound Column
property to 1, Columns to 5 and Column Width to 0;2;0;0;0.
The dropdown will display Location for you to select.
Put the following code in the AfterUpdate event of the combobox:
Me!NameOfCodeTextBox = Me!NameOfComboBox.Column(1)
Me!NameOfProvinceTextBox = Me!NameOfComboBox.Column(2)
Me!NameOfRegionTextBox = Me!NameOfComboBox.Column(3)
Be sure to put your names in for the textboxes and the combobox.
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com
<sw********@hotmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
I have an Access data sheet for traffic in Saskatchewan. 4 of the
columns are:
Location, Code(area code of the location), Province, Region
Obviously for each location, the code, province and region are the
same for that respective location. I am trying to make it so that
when I select a location (using a dropdown box) that the province,
region and code are automatically filled in. I do not need an exact
answer, just some details of where to look. I have went through the
Access manual for SQL commands and Quereys and have not found
something that will help me.. if anyone knows where to look to achieve
this please let me know, as well, if someone knows that this is in
fact impossible in Access, that would also be appreciated
Thank you,
John