2115 error with a listbox control

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
 
D

Douglas J Steele

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top