Combo Box Selection Locks Form

255 pts.
Tags:
combo box
list box
Microsoft Access 2003
VBA
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

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • McNitro
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following