N
Noel
Hi. Ive posted something similar to this recently and had
some help from Larry Linson but the thread got messy (my
fault) I thought a repost with clarification would be
best. In very general terms the question is this, is it
possible for Access to automatically take a copy of the
value in one records field and use it to update another
records field, based on the users selection in a Combo
box.?
Heres more detail. Say I have a form with a control
source as tblStudents and a combo box in a subform that
allows the users to select a School from tblSchools.
This puts the SchoolID in tblPlacements. Each record in
tblPlacements therefore records a Student placement in a
School. Now say I have a field called PlacementStartYear
in tblSchools and one with the same name in
tblPlacements. What I want is, once the user selects a
particular School in the combo box, access automatically
goes to that record in tblSchools, takes note of the
value in field PlacementStartYear and uses that value to
update the PlacementStartYear field in the current
tblPlacements record. The operative word here is
automatic. I know I could just provide a txt field in the
subform for the user to enter the PlacementStartYear in
the Placement record but I think Access could be made to
do this automatically. Also, this automatic updating of
the PlacementStartYear field should happen when the
School is either first selected or when it is reselected
(the users often have to change the placement school).
Lastly, another major aspect is that the
PlacementStartYear value in tblSchools changes from one
year to the next so the idea is to ensure that the value
automatically entered in the Placements record is the
value current at the time the Placements record was
either created or updated. The
tblPlacements.PlacementStartYear value must not track the
changes to the tblSchools.PlacementStartYear field.
Is this possible? Could this be done by building some
sort of Event code associated with the combo boxes
AfterUpdate or On Change property? Are there any
examples anywhere showing this type of thing? Sorry if
this has been very longwinded. Thanks for your time.
Cheers, Noel
some help from Larry Linson but the thread got messy (my
fault) I thought a repost with clarification would be
best. In very general terms the question is this, is it
possible for Access to automatically take a copy of the
value in one records field and use it to update another
records field, based on the users selection in a Combo
box.?
Heres more detail. Say I have a form with a control
source as tblStudents and a combo box in a subform that
allows the users to select a School from tblSchools.
This puts the SchoolID in tblPlacements. Each record in
tblPlacements therefore records a Student placement in a
School. Now say I have a field called PlacementStartYear
in tblSchools and one with the same name in
tblPlacements. What I want is, once the user selects a
particular School in the combo box, access automatically
goes to that record in tblSchools, takes note of the
value in field PlacementStartYear and uses that value to
update the PlacementStartYear field in the current
tblPlacements record. The operative word here is
automatic. I know I could just provide a txt field in the
subform for the user to enter the PlacementStartYear in
the Placement record but I think Access could be made to
do this automatically. Also, this automatic updating of
the PlacementStartYear field should happen when the
School is either first selected or when it is reselected
(the users often have to change the placement school).
Lastly, another major aspect is that the
PlacementStartYear value in tblSchools changes from one
year to the next so the idea is to ensure that the value
automatically entered in the Placements record is the
value current at the time the Placements record was
either created or updated. The
tblPlacements.PlacementStartYear value must not track the
changes to the tblSchools.PlacementStartYear field.
Is this possible? Could this be done by building some
sort of Event code associated with the combo boxes
AfterUpdate or On Change property? Are there any
examples anywhere showing this type of thing? Sorry if
this has been very longwinded. Thanks for your time.
Cheers, Noel