Problem with Combo Box

  • Thread starter Thread starter Chaplain Doug
  • Start date Start date
C

Chaplain Doug

Access XP. I have a combo box named SAPSTATUS in a form
which should only allow the values "Interview" or "Remove"
to be entered. I have set Limit to List to "Yes." I have
code that runs on the Change event. In this code I test
the value of the control. If the user enters "Interview",
then the value of the control upon entry to the code
is "Interview." However, if the user blocks
out "Interview" and hits the backspace (thus deleting the
value), upon entry to the code the value of the control is
still "Interview." However, upon return from the event
routine, the value is indeed deleted. How may I know that
the user has deleted the value in the control when I get
to the Change event routine? Thanks.

Chaplain Doug
 
Doesn't AfterUpdate only trigger when you move to another
record? I need to catch changes being made while still on
the same record.

That's the *form's* AfterUpdate event. Each control has its own
AfterUpdate event which fires when the user exits the control after
having changed something, or when they select a row from a combo or
listbox.
 
True. But the control AfterUpdate event occurs after the
AfterChange. I need to us the AfterChange. My original
question still stands. Thanks.
 
Test the .Text property of the combo box as well as the .Value property. The
..Text property will be what is currently visible in the combo box display.
 
Hi,
Have you tried checking the Text property of the combo?
That should give you the empty string.
 
True. But the control AfterUpdate event occurs after the
AfterChange. I need to us the AfterChange. My original
question still stands. Thanks.

The Change event fires once with every keystroke; if you have a Combo
based on a text field, the Change event will fire multiple times as
the user types to autocomplete a selection.

What event do you need to happen *that often*?
 
Back
Top