255 pts.
 Combo Box Selection Locks Form
I have a combo box that locks/corrupts all of the controls on a Access 2003 form.  The locking symptom only seems to occur when the list index is greater than 0.

The problem control may not be the combo box.  It may be one of two list boxes that are affected by the combo box's 'after update' event.

In the combo box's 'after update' procedure, the data for the two list boxes is updated according to the combo box selection. To update the combo boxes, I have code that first clears all the current items out of each list box.

The code to clear each list box is as such:



     intListCount = Me.lstScheduled.ListCount     intListIndex = intListCount - 1     Do Until intListIndex = -1         Me.lstScheduled.RemoveItem (intListIndex)         intListIndex = intListIndex - 1     Loop

    intListCount = Me.lstAvailableTests.ListCount     intListIndex = intListCount - 1     Do Until intListIndex = -1         Me.lstAvailableTests.RemoveItem (intListIndex)         intListIndex = intListIndex - 1     Loop



Clearing the first list box seems to cause the corruption.  If I comment out that portion of the code, the problem seems to go away.

I don't understand why this is happening, because both sets of code are identical, but only the first seems to cause the issue.  I have renamed the problem list box (lstScheduled). I have deleted it and re-created it. I have also renamed and re-created the combo box.

Please help me understand what is going on here.

Thanks!



Software/Hardware used:
Access 2003, Windows XP
ASKED: October 8, 2010  4:08 PM
UPDATED: October 8, 2010  5:13 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Note:

When the form is seemingly “locked”, what is actually occuring is the ‘after update’ code is being run by clicking on any part of the form. So if I click on a command button, it bypasses the ‘click event’ for the command button, and runs the ‘after update’ code for the combo box.

 255 pts.