PDA

View Full Version : Protect Field Question


ABC123

sherri ettore
06-07-2000, 01:53 PM
I am building a database for my sales staff. I want to protect the Sales Rep field from being changed once it has been entered. As a very new person to using this software to create this type of program, I need help.

How can I allow entry of data into the field once, then force the curser to skip the field when others are reviewing the record so they can't change the sales rep name (claiming the lead as their own)?

I hope you can help

Melvin Davidson
06-08-2000, 11:25 AM
Sherri,

I believe what you want can easily be accomplished. Then again, I also believe I'm going to win lotto and find the girl of my dreams. :).

From the control panel.
1. Select the database
2. Select Database, Field Rules
3. Select your "Sales Rep" field.
4. Click Events.
5. Select Can Edit Field
6. Code something like

DIM SHARED A_FIELD_VALUE AS C
DIM SHARED A_CAN_DO AS C

IF alltrim(A_FIELD_VALUE) >"" THEN
A_CAN_DO = "F"
END IF

Don't forget to save the script with a meaningful name
like "Check Field entered" or something else you like.

Look at the Function Help and
A_CAN_DO:in field events
for more info.

Melvin Davidson
06-09-2000, 05:28 AM
Oops, I goofed.

The correct "Can edit field" field rule script should look like:

DIM SHARED A_FIELD_VALUE AS C
DIM SHARED A_CAN_DO AS C

IF alltrim(YOURDB->SALES_REP) >"" THEN
A_CAN_DO = "F"
END IF

BTW, This also works in browse mode!