Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I tell if a record is locked? (2002 SP3)

    How can I tell, in DAO code, if a record is locked?
    I have 2 Dbs using the same data,
    Regards,
    Peter

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: How can I tell if a record is locked? (2002 SP3)

    I'm a little confused - do you have two separate front-end databases being used to access data with different forms by different users, or is this one user who has two different forms up that both refer to the same data source? In any event, there isn't a way using DAO to tell whether a record is actually locked, other than trying to edit the record and see if you get a locking error. In general, we always use optimistic locking, which is the "No Locks" option, which means you don't get an error until the record is actually saved. A final question: are your forms both bound to a data source, or are you using unbound forms and DAO to do any editing?
    Wendell

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How can I tell if a record is locked? (2002 SP3)

    Both forms are bound.
    The set up is: 2 separate front end Dbs, One I call
    Regards,
    Peter

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How can I tell if a record is locked? (2002 SP3)

    No Locks has nothing to do with Record Level Locking, although it's easy to get confused because of the names. No Locks means that a lock is not applied until you attempt to update the record and it is used instead of Optimistic or Pessimistic locking, which are both applied as soon as you start to edit. Record Level and Page locking are the two different approaches used when actually applying locks.

    However, if one of your users is using page locking, then that may very well be the source of the problem. Even if they're both using record level locking, they can't both edit the same record at the same time.
    Charlotte

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: How can I tell if a record is locked? (2002 SP3)

    There isn't any easy way to look into a second database and check to see if a particular form is open, much less what record is it on - why not simply put both forms in the same front-end database? Furthermore, one of the basic rules of user interface design in Access - keep open forms down to a minimum. When you start stacking lots of open forms, things can get chaotic in a hurry. We normally restrict it to one open form and allow one pop-up form on top of it when needed.
    Wendell

Posting Permissions

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