P
PeterM
I have the following code setup. My form has 5 listboxes on them named LB1
thru LB5. All listboxes are single select. The code simply captures which
listbox has been clicked (onClick event) then it does some stuff (not
included in following code) and finally deselects the entry in the listbox.
It's giving me fits. It will not deselect the entry.
Can anyone tell me what I'm doing wrong? thanks
Dim ctlCurrentControl As Control
Dim strControlName As String
Dim intCurrentRow As Integer
Dim tmp_selected As Integer
Set ctlCurrentControl = Screen.ActiveControl
strControlName = ctlCurrentControl.Name
tmp_selected = Me(strControlName).ListIndex
Me(strControlName).SetFocus
For Each varItem In ctlCurrentControl.ItemsSelected
ctlCurrentControl.Selected(varItem) = False
Next varItem
Set ctlCurrentControl = Nothing
thru LB5. All listboxes are single select. The code simply captures which
listbox has been clicked (onClick event) then it does some stuff (not
included in following code) and finally deselects the entry in the listbox.
It's giving me fits. It will not deselect the entry.
Can anyone tell me what I'm doing wrong? thanks
Dim ctlCurrentControl As Control
Dim strControlName As String
Dim intCurrentRow As Integer
Dim tmp_selected As Integer
Set ctlCurrentControl = Screen.ActiveControl
strControlName = ctlCurrentControl.Name
tmp_selected = Me(strControlName).ListIndex
Me(strControlName).SetFocus
For Each varItem In ctlCurrentControl.ItemsSelected
ctlCurrentControl.Selected(varItem) = False
Next varItem
Set ctlCurrentControl = Nothing