Yes,
I have relevant tables etc. as follows:
AreaProvince with primary key ProvinceID
AreaDistrict with primary key DistrictID and a foreign key ProvinceID
AreaCommune with primary key CommuneID and foreign keys ProvinceID and
DistrictID
AreaVillage with primary key VillageID and foriegn keys ProvinceID,
DistrictID and CommuneID
Now, those tables are just the lookup tables which have the ID codes
(which
are official codes that they use nationally) and the names of each
area.
The tables that i am trying to enter data in via these forms are for
recording various details of our project's activity in each village (we
are
an development NGO working in communities). There are a number of
these
tables for different stages of activity. For example i have one
recording
identified problems and solutions (TableName VillageProblemAnalysis) so
for
that i have an autonumber ID for - primary key and then i have the
province,
district, commune and village IDs stored. this looks up the area
tables
listed earlier. these 4 IDs together identify the exact village. the
combo
boxes display the names but the IDs are stored. the combo boxes work
great
for adding a new record but when i go back and look at previous records
the
names displayed for the areas have changed according to the latest
record
entered.
for example if i enter:
Record 1: provinceID=13 (preah vihear); districtID=02 (rovieng);
communeID=01 (robieb); villageID=04 (tandrak)
Record 2: provinceID=17 (siem reap); districtID=01 (angkor chum);
communeID=02 (Don peang); villageID=01 (tanout)
now when i go back to look at the first record, after i enter the
second
record, the names in the district field show the names based on the
last
query on the last record (so for record 1 it changes to show the
district
#02
in siem reap province instead of preah vihear province because Siem
Reap
was
selected in the second query) - the underlying ID number is still the
same
and correct. if i didn't want to display the names it'd be fine.
not sure if this is any clearer! thanks. i am in civilization for a
few
days so can respond quicker for the rest of the week!
:
Would you post the names of the relevant tables, the primary key and
foreign
key for the table, and the relationships between the tables.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
in
message Hi Jeanette, just back online again - haven't been able to get
hooked
up
for
a while.
thanks for the explanation-- i just worked that out after i went
home
and
tried again what you explained. So it didn't quite solve my
problem.
the
problem is that i actually want to store the look ups in the
underlying
table
which means that whenever i query on the next record it changes
whatever
the
displayed on the previous record. Not sure if i am being very
clear!
I'll
try writing it out again and see if i can be clearer.
Thanks so much!
:
Binding a combo means that when you make a selection in the combo,
your
selection is saved in the table, in the field the combo is bound
to.
If the combo is unbound, it still uses a table as its row source.
The
difference is that you can select from the combo without saving the
selection back in a table bound to your form.
"SharynInCambodia" <
[email protected]>
wrote
in
message Thanks Jeanette for the help. Sorry i haven't been able to get
internet
for
the last week so only just got your response. Aren't the
commune,
district,
province combo boxes bound to the tables that they are querying
from?
For
the properties of the combobox they are currently bound to the
column
that
i
want to store (Province ID etc.) Unless i am looking at another
place
for
the combo box to be bound.
thanks again!
Actually, just tested - for bound column, i typed in unbound (and
took
out
the column number). seems to help a bit. i'll keep testing
that.
Thanks!!
may have solved my problem.
:
Hi SharynInCambodia,
check that the combos for commune, district, province etc are
unbound.
The
only bound combo for this will be the combo for village.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria
Australia
"SharynInCambodia" <
[email protected]>
wrote
in
message
Hi, I have a problem with a form. I have designed a form for
entering
information for a village (which is further defined by a
commune,
district
and province - ie. you first choose which province, then which
district,
then
which commune and finally which village). I have place name
tables
that
list
all the respective place names. When I choose a province and
then
go
to
choose a district, it filters the district names to the
province
that i
chose. Once a district is chosen, then the communes are
filtered
to
those
communes in that district, and so forth, through till we
choose a
village.
This works by defining criteria, but then if i make a change
in
any
of
the
place name fields selected, it does not requery. So, i have
used
a
requery
code in AfterUpdate. Saved in the fields is the primary key
(a
number
and
not the place name) - but it displays the place name (as it
should
be).
This then works great - except when i go to the next record to
enter
or
edit, which also works - but then on returning to the first
record,
it
is
requeried according to other record and the old names are not
displayed
but
names based on the requery in the other record. And this is
where i
am
stuck!
I would really appreciate any help. Thank you thank you!