Jump to content

How can I lock a file so no new records can be created?


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

Recommended Posts

I would like to lock one of my DB files so that a new record can ONLY be created by running a script in another file? I would like to do this to avoid DUPLICATE join files. Here is my setup:

I have 3 files: an invoice file, a payment entry file, and a payment items file. The Invoice and payment files are reltated by the key field "invoice_id". The payment entry and payment item files are related by the key field "payment_id". A script in the Invoice file copies the value of "invoice_id" into a global and takes the user to the payment entry file. Another script creates a new record and pastes the global into the payment "invoice_id" field. This keeps the invoice_id constant in each of my files (Is this the worng way?). I am using an IF-ELSE validaiton script to keep the user from creating a duplicate from the script entry in the Invoice file. However, a user could still press "Command-N" and manually create a new record in the payments file. Since they didn't use the script, the validation doesn't run and I end up with two files with the same "invoice_id".

Maybe I'm approaching this the wrong way.

Any help is GREATLY appreciated.

Thanks!

Link to comment
Share on other sites

You need to create a user password with the "Available Menu Commands:" setting set to "None". With this accomplished, the only way a user has to create a new record is to run a script.

I'm guess that when you say "files" you really mean "records" ("two files with the same invoice_ID"). In database design this is like mixing up the terms "asprin" and "cyanide" in medicine! wink.gif" border="0.

-bd

Link to comment
Share on other sites

This topic is 8513 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.