I've made a form called Add_Training with a multi-select combo box (not a list box) that is bound to a table called Trainees. The user is supposed to select the names of one or more trainees from the drop-down list. I enabled "Allow Value List Edits" on the combo box properties and made a second form called Add_Trainee that opens when the value list is edited.
It all works fine. When the value list is edited and form Add_Trainee closes, the name of the newly-added trainee appears in the drop-down list of the combo box. However, the newly-added trainee is not selected on form Add_Training (i.e. box not checked and name not displayed in the text box). I thought it would be nice to have the new trainee already selected when the user is returned to form Add_Training so they don't have to scroll through the whole list and check the box themselves.
I started exploring ways to do this and was surprised to find that none of the properties that are supposed to indicate which combo box items are selected seem to work. The ItemsSelected collection is always empty, even when boxes are checked, so I can't iterate through ItemsSelected to obtain the identity of the selected trainees. Likewise, when I iterate from 0 to .ListCount for the combo box the .Selected property is zero for every item even when boxes are checked. And most importantly, setting .Selected to True for a list item does not cause its box to be checked or its name to be displayed in the text box.
I am running Access 2007, and all of this stuff is supposed to work for combo boxes under that version. What am I doing wrong?
-Marc
It all works fine. When the value list is edited and form Add_Trainee closes, the name of the newly-added trainee appears in the drop-down list of the combo box. However, the newly-added trainee is not selected on form Add_Training (i.e. box not checked and name not displayed in the text box). I thought it would be nice to have the new trainee already selected when the user is returned to form Add_Training so they don't have to scroll through the whole list and check the box themselves.
I started exploring ways to do this and was surprised to find that none of the properties that are supposed to indicate which combo box items are selected seem to work. The ItemsSelected collection is always empty, even when boxes are checked, so I can't iterate through ItemsSelected to obtain the identity of the selected trainees. Likewise, when I iterate from 0 to .ListCount for the combo box the .Selected property is zero for every item even when boxes are checked. And most importantly, setting .Selected to True for a list item does not cause its box to be checked or its name to be displayed in the text box.
I am running Access 2007, and all of this stuff is supposed to work for combo boxes under that version. What am I doing wrong?
-Marc