Results 1 to 10 of 10
  1. #1
    netchie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    92

    Unhappy How can you make a combo list unclickable?

    Hi,



    I have description list (desc) where if you chose certain description (mild, medium, severe) the next combo field beside it (level) will auto populate a number (e.g. 1,2,3,4,5). The thing is, some users are getting used of forcedly changing the level if they feel like it. Let's say if they choose mild from Desc list, the level field should auto-populate to "1" but most of the time users changed this level to different number from the list because it's clickable.

    Is it possible to make it unclickable as soon as it auto-populate the right level from the list? Can you please let me know how to do this?

    Thanks in advance,
    netchie

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    You can lock it using

    Me.ComboNameHere.Locked = True


    but why even have a combo if it is not supposed to be used?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Why are you using a combobox if users should not have a choice? Maybe you need to limit user choices by filtering the combobox based on choice in first combobox (cascading or dependent comboboxes).

    As far as I know, can't make non-clickable. You could disable the combobox based on choice in first combobox.
    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.

  4. #4
    netchie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    92
    Well, basically we're looking for a specific level. A group will check them if it can be changed to lower level. The thing is, the users already deciding to change it by themselves before data can reach the group who are checking those level. To make it short, there is a group who will decide if the level can be changed to different level but the users are trying to mess it up lol.

    @boblarson - where should I put that? When I clicked the Event Procedure for Level, there is already an existing "Private Sub" whatever inside. Should I create a new "Private Sub" for it and put the command you gave me?

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Put it in the AFTER UPDATE event of the first combo box. And no, you don't create a new Private Sub - you just put it between the existing:

    Code:
    Private Sub Form_AfterUpdate()
       Me.YourSecondComboBoxNameHere.Locked = True
    End Sub
    But actually, given your situation, why not just lock it in design view and then have a password protected button to unlock it for those who are supposed to review it so they can change it if necessary.

  6. #6
    netchie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    92
    This is what I put in After Update - Event Procedure:

    Private Sub cbLevel_AfterUpdate()
    Me.cbPriority.Value.Locked = True
    End Sub

    ...it didn' work

    I also tried this:

    Private Sub cbLevel_AfterUpdate()
    Me.cbPriority.Locked = True
    End Sub

    ...same result

    cbLevel auto-populate based from what the user chose from the Desc list. cbLevel needs to be unclickable/grayish as soon as it auto-populate.

    Sorry for being pain in the butt

  7. #7
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Did you try clicking on it to see if it could be clicked on? (the second one was the correct one, by the way).

    If you want it grayed out, then change .Locked to .Enabled and change True to False:

    Me.cbPriority.Enabled = False

  8. #8
    netchie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    92
    @boblarson - nevermind. I put it in a wrong field that's why. I corrected it and IT WORKED! Wooo Hooo!!

    Thanks boblarson and June 7 for checking this for me.

    netchie

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    I would set the combobox as disabled in Properties then use code to enable it when appropriate. You can still use code to autopopulate. This way, it will never be available to users. They can't accidentally enter value in that combobox and overlook the first one.

    Possibly don't need password control. If you have a way to distinguish between user/group then can enable controls as appropriate when form opens. Should group be allowed to change first combobox value?
    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.

  10. #10
    netchie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    92
    Got it! Thanks again June7

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

Similar Threads

  1. Buttons Unclickable Anymore
    By netchie in forum Access
    Replies: 7
    Last Post: 09-14-2011, 11:06 AM
  2. Combo List
    By gbwiii in forum Forms
    Replies: 1
    Last Post: 05-19-2011, 10:46 PM
  3. Replies: 6
    Last Post: 02-09-2011, 07:30 AM
  4. Combo box for list
    By Danzig in forum Forms
    Replies: 6
    Last Post: 11-03-2010, 05:18 PM
  5. combo box value list
    By thewabit in forum Forms
    Replies: 13
    Last Post: 01-13-2010, 07:50 PM

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