Below is some simple code to emulate the problem I am having.
Assume combobox control is cboTest and command button control is cmdTest.
Expand|Select|Wrap|Line Numbers
- Private Sub cboTest_AfterUpdate()
- MsgBox ("Change")
- End Sub
- Private Sub cmdTest_Click()
- Me.cboTest.SetFocus
- Me.cboTest.ListIndex = Me.cboTest.ListIndex - 1
- End Sub
All of this works except when I use the command button all the code in the afterupdate event of the combobox runs twice.
Any ideas what I am doing wrong or not understanding?
(Note code simplified for demonstration purposes - Note you must first select the 2nd or third item before clicking on the command button for this simple code to work. - it still fails with this simple code) - Using Access 2007
cheers,