View Full Version : locked and unlocked records


Webster01
03-25-2002, 11:33 AM
I am keeping a database of medical patient visits. The information is entered into the table through a form. Once an encounter is conplete, I would like to lock that particular record, however, I may be working to complete documentation of several patient visits at once and may not be able to complete as many as ten encounter documents until the end of the day. I have been able to lock all of the records at once or unlock all at once but I need to be able to lock individual records on completion and leave the unfinished unlocked while still moving on to new records. I would then go back into the unlocked (and unfinished) records at the end of the day, complete them, print them and lock them. How do I lock completed records while still keeping only incomplete records unlocked.

thanks in advance.

Jonathan Kok
03-26-2002, 07:25 AM
Don't know if this will help, but...

Add a Yes/No field to your table. This will be your 'locked' field. Add the field to your entry form. On your form, create an 'On Current' event. Check to see if the record is locked by referencing this field in the On Current event. if it's locked (checked), don't allow edits, if it's not locked, allow edits (Form.AllowEdits = False/True).

As an additional feature, on the 'Before Update' event, ask the user if he wants to lock the record or not (if yes, then set the 'locked' field to true).