Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / April 2008

Tip: Looking for answers? Try searching our database.

Cancelling a selection in an unbound listbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
justme0010 - 09 Apr 2008 03:04 GMT
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?

Signature

justme0010

Ken Snell (MVP) - 09 Apr 2008 03:15 GMT
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.

Signature

       Ken Snell
<MS ACCESS MVP>

> I have tried to prevent certain changes in an unbound listbox control
> with the statement "Cancel = True" in the BeforeUpdate event, but that
[quoted text clipped - 3 lines]
> situation, I am trying to prevent the highlighting of a different item
> in the listbox. Is there any way I can do that?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.