My application is split into a front end and back end. Each user has their
own copy of the front end.
There are a few forms I only want to be open for one user at a time. So I've
implemented the following strategy:
1) Create a table with the fields FormName, OpenStatus, FormUser
2) When a user tries to open the form, the code in the Form Load event checks
the table for the OpenStatus value (True/False).
3) If the status is True, then someone else has the form open on another
machine and this user cannot open the form. A BypassCloseFlag is set and then
DoCmd.Close for the form is executed. The BypassCloseFlag prevents execution
of the code in step 5 below.
4) If the status is False, then the table record is updated to FormUser =
CurrentUser ande OpenStatus to True.
5) In the Form Close event, there is code to set OpenStatus to False and
FormUser to spaces as long as ByPassCloseFlag is not set to true.
This is all working fine, but I have the following concern.
What if the system crashes while this form is open and the user cannot close
it in a normal fashion which sets the table field for OpenStatus to False.
Subsequently, isn't there the potential that OpenStatus could remain set to
True with no one being able to open the form at all.
My users do not have any direct access to tables because I have locked down
the app using the startup options. Also, no user has direct access to the
backend file so it can't be opened.
Someone might suggest try it and see what happens. However, I don't wnat to
crash my system on purpose for testing. I might try it after I've implemented
something that I've been reasonably assured will work. But crashing the
system on purpose makes me nervous.
I guess I could include a form for the administrators to be able to reset the
OpenStatus to false for all form names in the table, but I wanted to see if
someone else has a suggestion.
Thanks.
--
Message posted via http://www.accessmonster.com