Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Closing an unattended form

    In our shared database is a job form which causes lock issues from time to time with people leaving it open.
    I would like to put a timer on the form lostfocus event that will cause the form to close if it has lost focus for, say 2 mins.
    I would need to get the code to check if the form has focus before closing after timing out in case the user has come back to it after the timer starts.

    If a user changes from access to outlook, does that trigger the lost focus event or is that only access specific?
    I guess this is the crux of my idea which I need a definitive answer on before beginning.

    Thanks in advance,

    Allan
    "Heading for the deep end"

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    Does each user have their a FE on their PC? This alleviates locks as you have found out.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Yes they do, but we still get occasional locks when people are trying to access the same record
    "Heading for the deep end"

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    So even if one of the users backs out of the locked record does it stay locked?
    The form has a timer event that can be used for closing the form after an amount of time.

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    So your locking issue is with a record in the back-end of the database, not with the form itself being locked. In that case a timer on the form is probably the best solution - start it when the form gets focus and if it hasn't been closed in a specified interval, close the form with whatever changes the user has made at that point. Of course you probably want to warn them before you do that, and that probably requires a separate form with it's own timer, as the MsgBox() function can be ignored
    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
  •