Results 1 to 6 of 6
  1. #1
    fotodj is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    6

    Locking Controls

    I have form with few fields which I would like to have changed into non editable after combo box named "Completed" is checked off.


    How can I do that?

    Dariusz

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You would do this in the After Update event of the checkbox, using

    Me!controlname.locked = True
    or
    me!controlname.enabled = False

    The difference is that setting Enabled to false also dims the appearance of the control - setting Locked = True doesn't, but both prevent editing.

    You need to take care of the case where the combo box is changed from Completed back to something else:


    If me!combocontrol = "Completed" then
    '
    ' Disable or lock controls
    '
    Else
    '
    ' Enable or unlock controls
    '
    endif

    HTH

    John

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Also, don't forget to put the same code in the Current event (or use a function) to handle the changing of records.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Thanks, Paul - I missed that.

    John

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    No problem John.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    fotodj is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    6
    John, Paul
    Thank you very much for your help , I will add it today.

    Dariusz

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

Similar Threads

  1. Locking a record
    By aytee111 in forum Access
    Replies: 3
    Last Post: 04-24-2012, 05:31 PM
  2. Replies: 5
    Last Post: 12-20-2011, 06:48 PM
  3. locking it down
    By BAX5127 in forum Access
    Replies: 0
    Last Post: 03-22-2011, 06:51 PM
  4. Locking Down Form
    By jo15765 in forum Forms
    Replies: 5
    Last Post: 11-16-2010, 04:44 PM
  5. Locking entries
    By jo15765 in forum Forms
    Replies: 11
    Last Post: 11-16-2010, 07:54 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