Results 1 to 4 of 4
  1. #1
    Sturgis76 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    4

    Locking a record on a form

    Hello,


    I have a form with various fields and a check box to lock the record. In the header of the form I have 2 search boxes that get locked when the box is checked. I would like to be able to still use the search boxes when the record is locked. Also I would like to add a yes or no message box when you check the box to confirm that the user wants to lock the record. Here is the code I have so far. Thank you for your help.

    Private Sub Form_Complete_Click()

    End Sub


    Private Sub Form_Current()
    If Me![form complete].Value = True Then
    Me.AllowEdits = False

    Else
    Me.AllowEdits = True
    End If






    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You can toggle the setting in the focus events of your search textboxes.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Sturgis76 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    4
    What code would you put in the got focus box?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Toggle the AllowEdits property.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Record locking on a shared form
    By Paintballlovr in forum Forms
    Replies: 2
    Last Post: 11-20-2013, 07:33 AM
  2. Replies: 3
    Last Post: 11-01-2013, 10:16 AM
  3. Locking a record
    By aytee111 in forum Access
    Replies: 3
    Last Post: 04-24-2012, 05:31 PM
  4. Record Locking
    By nyAccess in forum Database Design
    Replies: 4
    Last Post: 07-17-2011, 05:40 AM
  5. Record Locking
    By jlclark4 in forum Database Design
    Replies: 10
    Last Post: 06-15-2011, 02:22 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