Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009

    Unanswered: Form Locking - identify user?

    Does anyone have a way to identify who is locking a record in a form? I have it set up to only allow one user to edit a record at a time, and they are inevitably stumbling on this as they pass information back and forth.

    I have some functions to identify usernames within the database, but not anything that identifies who has a specific record locked.

    Thanks in advance

  2. #2
    Join Date
    Dec 2004
    Madison, WI
    One way I could think of doing this would be to have a table which writes the record ID (ie. autonumber field number) and username (from the getuser routine posted in the code bank), and the date/time.

    When a user opens the form to a specific record, have it (perhaps in the OnOpen event of the form), write to this table with that info. This would be to keep track.

    Then you may also want to have a field in the actual data table (ie. Yes/No type) which marks it as Yes for that record when the form is opened (on that record) and then marks it as No when the form is closed. If another user is opening the form on that record, you could have a routine (or simple dlookup command) to see if that field is marked as Yes/True. If so, then present your message that the record is currently being edited by another user and locked.
    Last edited by pkstormy; 06-01-09 at 20:33.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts