Results 1 to 2 of 2
  1. #1
    jlgray0127 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    185

    Arrow Help! Locking records

    Good morning!


    I'm using the below code. It works great, with the exception, if the record is today's date, it's locking it.
    I think it has something to do with the way I wrote the condition for checking the date. It's not seeing the +1 for the date.
    I want them to be able to update the record, until the Me.End_Date is later than today's date +1.
    Thoughts on my error? I can adjust the record if End_Date is tomorrow, but not today's date. Thank you!

    Private Sub Form_Current()
    If Me.End_Date > Date + 1 Then
    Me.Toggle37.Locked = True
    Me.Toggle38.Locked = True
    Me.Toggle39.Locked = True
    Me.Score.Locked = True



    Else: Me.Toggle37.Locked = False
    Me.Toggle38.Locked = False
    Me.Toggle39.Locked = False
    Me.Score.Locked = False
    End If
    End Sub

  2. #2
    jlgray0127 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    185
    in the line "If Me.End_Date > Date + 1 Then", the code is actually written "If Me.End_Date < Date + 1 Then"

    If it's >, all the records are unlocked.

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

Similar Threads

  1. Manually Locking Records for Editing
    By always404 in forum Forms
    Replies: 2
    Last Post: 01-31-2013, 11:17 AM
  2. Locking Controls
    By fotodj in forum Forms
    Replies: 5
    Last Post: 09-05-2012, 04:45 AM
  3. locking it down
    By BAX5127 in forum Access
    Replies: 0
    Last Post: 03-22-2011, 06:51 PM
  4. Locking fields
    By Icewolf0927 in forum Forms
    Replies: 3
    Last Post: 09-23-2010, 12:01 PM
  5. Locking Records in Subform
    By MuskokaMad in forum Forms
    Replies: 1
    Last Post: 04-02-2010, 06:34 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