Jump to content
Server Maintenance This Week. ×

How to Duplicate & Then Lock Previous Record


This topic is 8576 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 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]

Link to comment
Share on other sites

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


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

Link to comment
Share on other sites

  • 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!

Link to comment
Share on other sites

This topic is 8576 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.