Results 1 to 8 of 8
  1. #1
    Mobile is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    11

    Record Locking after the edition, access 2010


    Hi, I am new to Access and need a little help.

    I am trying to lock a single record of a form, after all the members edited the form so nobody can come back to the record and edit after that. But I don't want to lock the database.

    Once the form manager clicks the submit button, the first record of the form should lock and then move on to the second record for a new project. I found a couple of codes online but I get error message when I click "Run". Also I'm not sure if I'm connecting the code to the Form right.

    Your help will be very much appreciated!!


    This is the Code example from the old post I was using:


    Private Sub Command357_Click()
    If Me.NewRecord Or IsNull(Me.DateCompleted) Then


    Me.AllowEdits = True

    '' if there is a sub form(s) use the following
    Me.SubFormName.Locked = False

    Else


    Me.AllowEdits = False
    '' if there is a sub form(s) use the following
    Me.SubFormName.Locked = True


    End If

    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The AllowEdits is attempting to set the mode of the form, not record. Is the form in Single record view?

    What is the exact error message?

    Is the subform actually named 'SubFormName'? Use your subform name.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Mobile is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    11
    I want to use one record of the form per a project (project 1 for record1, project 2 is record2). I want to be able to lock each record when the project information is complete.

    I'm not sure what you mean by sub-form. Should I just take off this part?

  4. #4
    Mobile is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    11
    I just found an old thread
    "i have created a payroll using access 2007. is there an option to lock only one specific record rather than the whole table.
    For example, if John is no longer an employee i want to lock it and never be able to unlock it again."
    https://www.accessforums.net/program...ord-11398.html

    Seems like the only option is to move a single record to the archive table.....

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Actually, the best practice is to filter the form RecordSource so undesired records are not displayed. What criteria could be used to filter? Is there a 'Termination Date' field? 'Moving' records is not advised.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Mobile is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    11
    June 7,
    Thank you for your response. I have no idea how to filter the form RecordSource... I will start researching.
    If you know any good thread for leaning how to Filter the form RecordSource, please let me know.
    I appreciate your help, thank you!

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    Mobile is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    11
    Thank you June 7. I will try that!

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

Similar Threads

  1. Replies: 1
    Last Post: 09-11-2012, 05:43 AM
  2. Locking a record
    By aytee111 in forum Access
    Replies: 3
    Last Post: 04-24-2012, 05:31 PM
  3. Record Locking Problem
    By Grendall5383 in forum Access
    Replies: 9
    Last Post: 12-05-2011, 09:45 AM
  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