T
Todd Lemen
I have a multiselect box in Access 2K. I am attempting to conditionally
select multiple items in the listbox according to the following code:
For i = 1 To (Forms!SelectionResults!Contacts_Subform.Form!List0.ListCount-1)
lngValue = Forms!SelectionResults!Contacts_Subform.Form!List0.Column(1,i)
If lngValue = lngCo Then
Forms!SelectionResults!Contacts_Subform.Form!List0.Selected(i) =
True
Else
Forms!SelectionResults!Contacts_Subform.Form!List0.Selected(i) =
False
End If
Next i
I have stepped the code through, and the program flows as expected, that is
to say, when the "lngValue" is equal to the previously set "lngCo", the
If...Else...Endif flows properly. However, when the code finishes, only the
last item found in List0 appears selected. It's as if the a user were
selecting items in the list one at a time, and not holding down the "Ctrl"
key... So, the question is, how do I programatically "hold down the Ctrl
key" for a multiselect list?
select multiple items in the listbox according to the following code:
For i = 1 To (Forms!SelectionResults!Contacts_Subform.Form!List0.ListCount-1)
lngValue = Forms!SelectionResults!Contacts_Subform.Form!List0.Column(1,i)
If lngValue = lngCo Then
Forms!SelectionResults!Contacts_Subform.Form!List0.Selected(i) =
True
Else
Forms!SelectionResults!Contacts_Subform.Form!List0.Selected(i) =
False
End If
Next i
I have stepped the code through, and the program flows as expected, that is
to say, when the "lngValue" is equal to the previously set "lngCo", the
If...Else...Endif flows properly. However, when the code finishes, only the
last item found in List0 appears selected. It's as if the a user were
selecting items in the list one at a time, and not holding down the "Ctrl"
key... So, the question is, how do I programatically "hold down the Ctrl
key" for a multiselect list?