2115 error with a listbox control

  • Thread starter Thread starter Rick A
  • Start date Start date
R

Rick A

I've created a listbox with multi select set to "none".

When I run the code below I receive a 2115 error on the setfocus when there is one item selected.

For Each varItm In Me!lstJumpHeight.ItemsSelected
Me!lstJumpHeight.Selected(varItm) = False
Next varItm
Me!cmdAddClass.SetFocus

If I change the listbox multi select to "extended" or "simple" it works.

What have I missed?

Thanks,

Rick
 
If you're trying to unselect from a listbox that doesn't have Multiselect
on, you can simply use

Me!lstJumpHeight = Null

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I've created a listbox with multi select set to "none".

When I run the code below I receive a 2115 error on the setfocus when there
is one item selected.

For Each varItm In Me!lstJumpHeight.ItemsSelected
Me!lstJumpHeight.Selected(varItm) = False
Next varItm
Me!cmdAddClass.SetFocus

If I change the listbox multi select to "extended" or "simple" it works.

What have I missed?

Thanks,

Rick
 
Back
Top