Results 1 to 5 of 5
  1. #1
    ErikAE is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    7

    Lock Value in Combo Box if Non-Blank

    I have two cascading combo boxes; one filters data for the next - nothing special.

    The first combo box – after performing a DLookUp in the ‘On Change’ event – will determine a value for the second combo box. If it determines a BLANK value, I want the user to change the value to anything provided in the drop-down in the second combo box. This works fine.



    But what I want to do is lock the value in the second combo box if the first combo box determines a NON-BLANK value; i.e. I don’t want the users to be able to change the second combo box if it is NOT BLANK. I don’t know how to do this.

    Regards.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Maybe set the combobox Locked or Enabled property?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ErikAE is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    7
    I attempted that, however the lock prevents the combo box from being updated; i.e. no value.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    You set the value of the combobox then set the Locked property? The code works for me.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    ErikAE is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    7
    Ah, you mean use code; I thought you were referring to the 'Locked' property.

    Okay, let me rustle up some code, & I'll see how I go.

    Thanks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 11-28-2012, 04:29 PM
  2. Combo Box showing Blank Values
    By glen in forum Access
    Replies: 5
    Last Post: 11-24-2012, 09:44 AM
  3. Combo Box defaults to Blank
    By jimmonator in forum Forms
    Replies: 13
    Last Post: 05-02-2011, 01:28 PM
  4. Blank Data to Combo
    By dlewicki in forum Access
    Replies: 10
    Last Post: 01-14-2010, 10:07 AM
  5. Blank combo boxes
    By ROBBO in forum Forms
    Replies: 3
    Last Post: 01-06-2010, 10:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums