• Closing an unattended form

    Author
    Topic
    #490039

    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

    Viewing 3 reply threads
    Author
    Replies
    • #1400470

      Does each user have their a FE on their PC? This alleviates locks as you have found out.

    • #1400681

      Yes they do, but we still get occasional locks when people are trying to access the same record

    • #1400723

      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.

    • #1400726

      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

    Viewing 3 reply threads
    Reply To: Closing an unattended form

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: