November 1, 200025 yr Newbies Hello, I am creating an inventory database where I need to save an inventory history. I need to be able to duplicate an existing record (simple enough) and then lock the original record so only the duplicated record can be edited. How do I lock the original record after creating a duplicate? Any info is greatly appreciated. Thanks! Tom Bardenwerper [email protected]
November 1, 200025 yr quote: Originally posted by Werper: Hello, I am creating an inventory database where I need to save an inventory history. I need to be able to duplicate an existing record (simple enough) and then lock the original record so only the duplicated record can be edited. How do I lock the original record after creating a duplicate? Any info is greatly appreciated. Thanks! Tom Bardenwerper [email protected] The easiest way I can think of is to have a flag in the record called Locked which is set to either 1 or 0. When you want to lock a record set Locked to 1. Whenever you have a script which could possibly allow the user to edit the record, check the value of Locked. If the record is unlocked, take the user to a layout that allows data entry. If the record is locked, take the user to a layout that only allows data viewing. Since it's only going to have a value of 1 or 0 (true or false), you can have your script do something like this: If [ Locked ] Go to Layout [ Data View ] Else Go to Layout [ Data Entry ] End If Chuck
November 2, 200025 yr Author Newbies quote: Originally posted by Chuck: The easiest way I can think of is to have a flag in the record called Locked which is set to either 1 or 0. When you want to lock a record set Locked to 1. Whenever you have a script which could possibly allow the user to edit the record, check the value of Locked. If the record is unlocked, take the user to a layout that allows data entry. If the record is locked, take the user to a layout that only allows data viewing. Since it's only going to have a value of 1 or 0 (true or false), you can have your script do something like this: If [ Locked ] Go to Layout [ Data View ] Else Go to Layout [ Data Entry ] End If Chuck Thanks Chuck! That did the trick!
Create an account or sign in to comment