Results 1 to 3 of 3
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 7 64bit Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    618

    Lock only the first record.

    Since I want to keep other records open for editing, I don't want other records to be locked. When opening forms it shows the first record in the query. Frequently the user mistakenly adjust the first record instead of clicking on add for a new one. I saw some VBA suggestions, but it seems it locks all records, but allow new ones. Is it possible to lock only the first record?

  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,518
    Don't think so. You can set AllowEdits to false in the current event, and have a button that toggles them to true.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Even if its possible, it makes no sense to do so as your users could then edit records 2, 3 etc
    If you don't want existing records edited, open the form locked
    To add new records, open the form in data entry mode

    DoCmd.OpenForm "MyFormName", , , ,acFormAdd

    These are the 4 possible modes

    acFormAdd 0 The user can add new records but can't edit existing records.
    acFormEdit 1 The user can edit existing records and add new records.
    acFormPropertySettings -1 The user can only change the form's properties.
    acFormReadOnly 2 The user can only view records.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Record lock question
    By NikoTheBowHunter in forum Access
    Replies: 3
    Last Post: 05-24-2017, 12:04 PM
  2. Edited Record Lock?
    By mrmims in forum Forms
    Replies: 1
    Last Post: 09-01-2016, 03:55 PM
  3. Record Lock when appending
    By Mick99 in forum Access
    Replies: 1
    Last Post: 07-07-2015, 10:11 AM
  4. Replies: 9
    Last Post: 05-12-2012, 12:16 PM
  5. lock a record
    By Nokia N93 in forum Programming
    Replies: 3
    Last Post: 02-21-2011, 02:51 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