Navigation Form and limiting Access to Form

JpSkyPilot

Registered User.
Local time
Today, 11:28
Joined
Feb 23, 2012
Messages
20
Hi.

I've built a program in Access 2010 for vehicles. I am using the Navigation Form to switch between forms in the database.

There is a form for editing a vehicle's information and I only want one operator at a time to be allowed to edit that info.

When an operator one clicks on the form, I can put that fact in an "In Use" table that an operator is using the form. So, when anyone clicks that button on their screen, it will check "In Use" to see if anyone is using that form. If so, it will not allow the second person access the form until the first person finishes and leaves the form.

However, how do I remove the operator one's info from the "In Use" table? If I am using the Navigation Form, the "Unload" event does not seem to fire.....if so, I could then take that operator's info out of the "In Use" table for that form...and the next person can get into it if they need to...

What event fires (if any) when operator one moves to a different form? (they click another button on the navigation form).... The program has about 50 navigation buttons and I cannot put a procedure in each one of them to allow for every possible combination :)

Hope this makes sense...any assistance and/or suggestion would be appreciated.

JpSkyPilot
 
Could you put code in the on_Load and on_Close events to update the record. The problem would be if someone left the screen up. This would lock everyone else out. You might want to add a timer to check if they are updateing the form within a certian time limit.
 
Thank you...I'll try this to see if it works for me...it is the end of the day; so I'll do it tomorrow...thanks again
 
Hi,

You could also use the "On Lost Focus" event if you want the form to be unlocked when a user simply navigates away from the userform and leaves it open.

An alternative would be to set the form's modal property to true, so that the form has to be closed before the user can do anything else. Then you can use the "On Close" event to unlock the form for another user
 
Thanks to both... I just did a msgbox in the OnOpen and OnClose...and it works...thanks to all
 

Users who are viewing this thread

Back
Top Bottom