Combobox ListIndex and AfterUpdate

jbenezech

Registered User.
Local time
Today, 19:59
Joined
Jun 23, 2006
Messages
13
Hi All,

I'm using Access 2003

I know there are a lot of problems related to the ListIndex property of a Combobox but could not find a post related to this one.
I attached a small DB that reproduces the problem:

I have a form with 2 textbox, 1 combobox.
- On the AfterUpdate event of textbox1, I set the listIndex of the Combobox to 1. The listIndex is set but I get a 7777 error message.
- On the Exit event of textbox2, I set the listIndex of the Combobox to 2. This works fine.

Any idea why I get this 7777 error when the listIndex is used inside the AfterUpdate of another control ?

I also noticed setFocus problems ("Access cannot move the focus right now") when used inside the AfterUpdate of a control but this problem is too inconsistent to produce a testcase.

My bottom line is I need to select an entry of a combobox based on the first column which is not the bound column (code/value rows).
I would really prefer to avoid using the ListIndex, setFocus as the behaviour of this methods seem extremely unstable and I suspect I'll get a lot of weird problems when the application will be deployed.
How on earth can I do that ?

Cheers,
Jerome
 

Attachments

I believe this will only set the value property of the list with the value of the bound column of the first row. Quiet far from what I need.
 
Then what are you trying to accomplish here?
 

Users who are viewing this thread

Back
Top Bottom