ComboBox ListIndex changes to -1

  • Thread starter Thread starter AirPo
  • Start date Start date
A

AirPo

I have a simple form with a combobox and a button. The button is only
enabled when the user selects someting from the dropdown list. The
logic to do this is the button is disable if the listindex property is
-1, enabled otherwise. This happens in the change event. The problem
is that sometimes even though I select an item from the dropdown, when
the change event fires, the listindex value is -1, and the button is
disabled even though something is selected.

Anyone?
 
I have a simple form with a combobox and a button. The button is only
enabled when the user selects someting from the dropdown list. The
logic to do this is the button is disable if the listindex property is
-1, enabled otherwise. This happens in the change event. The problem
is that sometimes even though I select an item from the dropdown, when
the change event fires, the listindex value is -1, and the button is
disabled even though something is selected.

Anyone?

Use the AfterUpdate event instead. Change is too much a hairtrigger -
it fires AT EVERY KEYSTROKE, not when a value is selected.

John W. Vinson[MVP]
 
John,
This from Access Help on Change Event -
"The Change event doesn't occur when a value changes in a calculated control
or when you select an item from the combo box list."
 
Back
Top