1. Create a table with a Yes/No field.
2. Place an invisible field on the form with the Yes/No field as it's ControlSource.
3. In the form's On Load event check the value of the field.
4. If it is No then proceed as normal and set the value to Yes.
5. If Yes, then MSGBOX and CLOSE.
6. When you close it set the value back to No.
Just a thought...
B-) ljprodev@yahoo.com
ProDev, MS Access Applications
I think I'll go with that idea. I was already toying with the idea of creating a "lock" table, but instead I had gone off on a tangent of putting a user name in the table and it was just getting too messy.
I like having a simple yes/no boolean though. Short and to the point.
An added thought. You may want to do the checking and setting of the Yes/No at the point the user clicks the button to open the form. This way you don't get into a mess when closing and resetting the value.
For example, if you open the form the flag is Yes.
Next person opens it and the form automatically closes, but this closing also sets the flag to No, now another attempt at opening the form will get a user in.
Just another thougth.
B-) ljprodev@yahoo.com
ProDev, MS Access Applications
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.