Results 1 to 3 of 3
  1. #1
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237

    lock and unlock buttons

    I have found this code which im trying to separate into 2 separate buttons lock and unlock...

    on form load if a check box its not checked the 3 other fields can have data inserted into them, if check box has been checked the fields are Lock.....

    once the fields have data the check box is checked, click a Lock and exit button to lock the record.... if I need to make changes was going to assign DLookup for the AccessLevel

    any help would be much appreciated, thanks.

    for the button click -

    Private Sub cmdLock_Click()
    If Me.AllowEdits = True Then
    Me.AllowEdits = False
    Me.cmdLock.Caption = "Unlock"
    Else
    Me.AllowEdits = True
    Me.cmdLock.Caption = "Lock"
    End If
    End Sub

    and on current event -



    If Me.NewRecord = True Then
    Me.AllowEdits = True
    Else
    Me.AllowEdits = False
    End If

  2. #2
    llkhoutx is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Toggle (True/False) the controls respective "Locked" property.

  3. #3
    ShaunG is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jan 2018
    Posts
    237
    Quote Originally Posted by llkhoutx View Post
    Toggle (True/False) the controls respective "Locked" property.
    Davegri gave me some pointers how to come up with a true/false toggle and adding in code to enable controls = false once toggle is pushed as well as toggle itself... works well, thanks for responding

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

Similar Threads

  1. Replies: 5
    Last Post: 11-13-2017, 02:09 PM
  2. Lock/unlock current record in continous form ?
    By Lukael in forum Programming
    Replies: 5
    Last Post: 02-17-2016, 01:04 PM
  3. Replies: 4
    Last Post: 08-19-2015, 12:56 PM
  4. Replies: 3
    Last Post: 01-26-2014, 06:32 PM
  5. Replies: 0
    Last Post: 03-08-2009, 05:12 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