views:

262

answers:

1

I'm using D2009, and I have a TDbComboBox on my form, and if I click on it, then click an option from the menu, the first time I do so it doesn't change. The OnChange event handler fires, but ItemIndex remains at 0 (where it started at) instead of being updated to reflect the new item. After this first time, it works fine.

Any idea what's causing this and how I can fix it?

A: 

What do you see if you step through the event handler in the debugger?

Are you doing anything funky with ItemIndex inside the event handler?

What happens if you comment out everything in the event handler?

Mark Pim
I'm not doing anything with the ItemIndex property in the event handler, and the value's supposed to have changed to reflect my new selection before the event handler fires anyway. So that's not the problem.
Mason Wheeler
Is the underlying dataset in dsEdit/dsInsert state when you select an item from the DbCombobox? Or is the DataSource.AutoEdit property set to True?
_J_