I have a quote program I have made and i'm looking for a way to lock the records once it has been approved. I have a form that is filled out and a calculation that is done based on the fields that are linked to an sql table. What method could I use to lock an estimate once it has been approved? Thanks in advance.

Recommended Answers

All 5 Replies

Have a boolean field to say "dont update any more"

I understand about adding a boolean field but not sure how to use this to lock the record.

You test if the value is set or not.. if it is dont let them change it
Or, you have to use multiple accounts within the app to connect to the database and have a special account that moves the record from one table to another where the second table is read only.. but thats complicated and leads to issues as you have more than 1 table to look up on.

Liz how do you stop them from changing the record using the test on the bit. Ok i know the bit says don't change it but what code locks the record?

well they can only update the record if your code lets them, so in your code allow them either to only hit save if the flag is not set, or, only run the save code if the flag is not set..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.