Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Database - Protect Form for single user..help!!!

Status
Not open for further replies.

MrsTFB

MIS
Oct 3, 2000
307
US
Help please... I have an Access97 database that is used by several users. I want the data entry form and an update form to only be available to one user at a time. I have tried the Lock Records property on the forms, but it does not solve my problem, it still let the second user open the form. I bet this is possible, surely we are not the only company doing this..
SURELY...i hope anyway. Any help is greatly appreciated.
Thanks in advance,
mrsTFB in Tennessee
 
The only idea that comes to my mind is to create a small table (for example with UserName & boolean)- if someone opens the form - update the table (set username = user & boolean = true).
When the user closes the form delete the entry (or boolean =false).

Before the form is opened - you can check if somebody has it already open.
 
You are kidding, is that really the only answer???

Thanks for your quick reply!
 
There is usually a reason why you want a form open to only one person at a time, and that involves...record-locking related reasons? I assume you want to do this because you don't want two people overwriting each other's data entry. You could do record locking set to "All Records" on your form properties, so that it essentially disallows anyone else access to the form. This is foolproof.

Unfortunately, this also locks users out of any other forms or whatnot that involve the locked records.


That is Access' built-in way of denying two users from modifying the same data. (the other way is to just allow two users to edit the same record, then pop up a box saying "this has been modified, overwrite the other person's modifications?")


cbsm's method is not perfect (doesn't protect against crashes--the "logged in forever" problem) - but it will do what you need. There is no centralized way to store "status information" in multi-user databases except to store the information in tables, or to use the built-in record-locking scheme provided by Access.


Maybe there's an underlying reason why you want to prevent simultaneous users of a form? Let us (me) know, and maybe we can provide a workaround.
 
Thanks so much for your replies....let me further explain. The form increments an RGR number when data is entered. The instance has occurred twice that one user was creating a new record, the number 357 was given and another user went in to create a new record and 357 was also given. I want to lock the second user out until the original 357 record is completed and written to the table. Does that make sense?
Thanks for your answers...
MrsTFB in Tennessee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top