Locking a field against editing isn't really a field format situation. That's a field behavior issue. See this thread for a technique that should do what you want:lock/unlock a record with a single click?
To see field pattern, you can simulate the effect with a calculation field.
Define a container field. Depending on your database structure and environment, this could be a global field or a field stored in a separate table, with a relationship that allows all your records in your main table to match to this one record in your related table. (Use the cross product operator "X").
While in layout mode, draw a rectangle on your layout and fill it with the desired color and pattern. Copy this rectangle to the clipboard. Enter browse mode and paste it into your container field.
Define a calculation field If(table::field = "value that means you want the pattern to appear" ; table::containerField, ""). Be sure to select container as the calculation fields return type. Place this calculation field behind the field you want to "conditionally format" and use Field/control | behavior to diable acess to this field. Set your original field to be transparent.
Now it looks like you've applied a conditional format to your field that supplies a fill pattern instead of just a color.
Concerning the disabling, I want to just disable an individual field in a given record, not disable the whole record.
Of course, I would want to enable that field in a given record, should the field for calculating it's value change back to "Yes".
Concerning the special background, I will have to play with your method and see how it works. Thanks for your help.
My apologies for sending you to the wrong thread. I knew this issue had been discussed before and didn't want to re-invent the solution. Try the following link: Re: Lock a record. Even though the thread title reads "lock a record" the accepted solution refers to a method that can be implemented for a specific field. See if that approach can work for you.
PS. I found this thread by clicking the "Advanced" link you see above and entering "Lock" and "Field" as my search text.
Thanks for your reply. Yes, I already have Calculation checks (validations) for many
of my fields, that give an error when an incorrect value is entered, and it resets the value
of the field. I also change the background color of the individual field, based on a calculation
that depends on how another field is set. This alerts the user that they really shouldn't go
setting the field being controlled.
However, what I am really trying to simulate is the effect you get when, in Layout Mode,
you go to Field Control --> Behavior and uncheck the "allow field to be entered" for Browse Mode.
When this is done, the user cannot enter the field. Clicking on the field allows no action and
there's no warning, no anything, and that's nice. What would be ideal is to have this affect
be controlled by a calculation (that's done in another field) to let the user to enter data
into the field (being controlled) when it's OK, and to block entry into the field (being controlled)
when it's not OK. Right now I don't see how that can be done.
The method that comes to my mind is to use a script trigger which, of course, is only an option if you are using FMP 10.
One of the triggered events is "On Object enter". If you set a script to this trigger, you can write the script to check to see if the person has access permission, If they don't, use go to field to take them to the next field in the tab order.
Thanks for your prompt reply. Sounds like Filemaker Pro 10
is the answer for what I'm trying to do. (I marked your answer
as the solution.) For now I'll just "struggle along" with
Filemaker Pro 9 advanced.
Here's a somewhat clumsy option for older versions:
Take the field out of the tab order so you can't enter the field by pressing the tab key.
Set up the field as a button and give it the same kind of script I described using with a script trigger.
It's clumsy because you can't tab into the field under any circumstances, but it does prevent entry into the field in browse mode unless the conditions you check with a script permit it.
Thanks for your extra ideas. What I basically wanted is this:
When FieldA = "Yes" , then FieldB is enabled and can be set with a drop-down menu.
When FieldA= "No", then FieldB is cleared and then disabled and nothing can be done with FieldB.
For now, I can reset FieldB automatically no matter what they enter, if FieldA= "No" (done by using a calculation
in FieldB that looks at the value in FieldA). If they do a manual override, then they're fully responsible for it.
Also I change the background color from grey to red for FieldB when FieldA= "No".
I think this is what I will use for Filemaker Pro 9 advanced.