Results 1 to 3 of 3
  1. #1
    AndreT is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    25

    Allow Read or Update dep on record

    I have a subform in a form, the subform is a datasheet based on a query, one of it's field is a userid field tracking who created the record.

    User wants the ability to update records they created, and read only records created by others.

    My intention is to make the form enabled or disabled depending on which record gets the focus.

    First I tried <On Current> event of the subform, got error 2164 - "You can't disable a control while it has the focus."

    Next I tried <On Enter> and <Got Focus> event of the subform fields to disable the form, that gave me the same error.

    Is what I want to do possible? Your advice is appreciated.

  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,521
    The current event is the place for the code. I'd set the allow edits property of the form, rather than disabling it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    AndreT is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    25
    Thanks Paul. That should work. I'll give it a try.

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

Similar Threads

  1. same form for new and update record
    By lizu in forum Forms
    Replies: 3
    Last Post: 06-20-2011, 08:34 AM
  2. Update Record button
    By Steven.Allman in forum Forms
    Replies: 1
    Last Post: 02-16-2011, 02:15 PM
  3. trying to update a record
    By mrsgwen in forum Access
    Replies: 1
    Last Post: 02-02-2011, 10:35 AM
  4. Update new record when leaving form
    By jpkeller55 in forum Access
    Replies: 6
    Last Post: 09-08-2010, 06:35 AM
  5. Replies: 2
    Last Post: 10-19-2006, 04:37 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