How is field sourced from a DLookup forced to refresh

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm an Access newbie.
I have a form with a combo field that allows the user to select a code that
describes an age range. I have created a text field that displays the
description for the age range code. The Control Source is
=DLookUp("[Description]","AgeCodes","[AgeCode]=[AgeOfContact]")
This works fine on the initial selection of an age code from the combo box,
but does not automatically refresh with the correct description when the form
user changes the age range code selection.
How can I force the description text field to update whenever a new age code
is selected?
 
Use Recalc to force the recalculation of a calculated control.
Me.Recalc

You might want to do that in the AfterUpdate event of the age code.
 
Allen,
Thanks for responding! Moments ago I just worked out how I could use the
AfterUpdate parameter on the AgeOfContact field to force a requery (and hence
update) of the age description field.

Allen Browne said:
Use Recalc to force the recalculation of a calculated control.
Me.Recalc

You might want to do that in the AfterUpdate event of the age code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

TESA0_4 said:
I'm an Access newbie.
I have a form with a combo field that allows the user to select a code
that
describes an age range. I have created a text field that displays the
description for the age range code. The Control Source is
=DLookUp("[Description]","AgeCodes","[AgeCode]=[AgeOfContact]")
This works fine on the initial selection of an age code from the combo
box,
but does not automatically refresh with the correct description when the
form
user changes the age range code selection.
How can I force the description text field to update whenever a new age
code
is selected?
 
Back
Top