Cancelling a selection in an unbound listbox

  • Thread starter Ken Snell \(MVP\)
  • Start date
K

Ken Snell \(MVP\)

Cancel = True

The above statement simply cancels the BeforeUpdate event, thereby
preventing the control from losing focus or from the choice causing an
update to the listbox's value. It will not prevent you from selecting
another item in the listbox, although that item might cause the "Cancel" to
occur, and still keep you locked in the listbox.

Tell us what you're trying to accomplish with your form and listbox. Then we
may be able to suggest other ways to accomplish that purpose.
 
J

justme0010

I have tried to prevent certain changes in an unbound listbox control
with the statement "Cancel = True" in the BeforeUpdate event, but that
doesnt seem to work. I have a single-selection listbox and all that
seems to do is not allow me to change focus to another control. I am
still able to make other selections in the listbox. In a certain
situation, I am trying to prevent the highlighting of a different item
in the listbox. Is there any way I can do that?
 

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