How to lock fields in Access 2010 based on date entered?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Milwaukee
    New Member
    • Apr 2014
    • 1

    #1

    How to lock fields in Access 2010 based on date entered?

    My Access knowledge is fairly basic. We have several users of a split database where we enter comments on daily basis to keep track of our work. The comments Form is set up so that today's day appears automatically and is protected, so all you can type in is your comment. I am wondering if there is a way to lock all comments with dates older than today to void any accidental edit or deletion of yesterday's and older comments. Thank you!
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    I would use the before update event in the details section of the form to check the date field against your cut-off date.
    If the condition exceeds your cut-off then set the before update cancel property to true which will cancel the edit.

    Please attempt to write the code first.
    If you have any errors or problems please read thru > Before Posting (VBA or SQL) Code repeating the debug/compile step as needed to find and fix all of the simple bugs (it stops on the first error, thus the need to repeat).

    Comment

    Working...