A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Cancelling a selection in an unbound listbox



 
 
Thread Tools Display Modes
  #1  
Old April 9th, 2008, 03:15 AM posted to microsoft.public.access.forms
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default Cancelling a selection in an unbound listbox

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.

--

Ken Snell
MS ACCESS MVP


"justme0010" wrote in message
...

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?




--
justme0010



  #2  
Old April 9th, 2008, 03:49 AM
justme0010 justme0010 is offline
Member
 
First recorded activity by OfficeFrustration: Sep 2007
Posts: 23
Default Cancelling a selection in an unbound listbox

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?
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.