Sounds like the checkbox is just a visual clue regarding the current record. The simplest way is in the Inspector go to the Data tab and under Behaviour area in the Field entry section uncheck Browse Mode. This applies only to the checkbox field on the current layout. No script triggers etc.
How do they set it the first time?
Change implies setting it the first time.
You cant let them click it and prevent them from clicking it at the same time.
maybe you want to be able to change the value by using your admin account but don't want normal users to be able to change it ?
You have at least 2 options if that's the case, is it ?
@MaxEh: The Check Box is more than just a visual clue to the current record. Toggling it on and off does put a zero or a 1 in the corresponding field in the TblMyInventory database.
It's a selection I do generally want the user to make. I do want users to be able to toggle it on and off most of the time.
However, there is certain other question in this form which, if they selection one specific answer to, then I want this Checkbox to be locked to a specific value. Put another way... if they select Option B in another field, then I want to set this Boolean Checkbox to a specific value and prevent the user from changing it.
(Incidentally, unchecking 'Browse Mode' in the Data tab didn't stop the checkbox from toggling between states, for some reason - seems odd.)
Thanks though for your efforts to help me.
@coherentkris They set if the first time (and unset it, and reset it) as many times as they like, by clicking it.
However I want to lock it - ie prevent them from changing its state further - if they select a different value from a completely different field.
I can do all of the above if it's just a standard text field. I can apply a script with the Script Trigger OnObjectEnter which forces the cursor to move to the next field, before they can change the current field. This in effect stops the field from being further updated.
However, this script approach doesn't work with the Boolean Checkbox button, for some reason.
Thanks though for your suggestion.
@siplus This is a "one user" application. So setting differentiated admin/user privileges won't solve my challenge, unfortunately.
Thanks though for your suggestion.
well just put a transparent rectangle over your checkbox and associate a script to it.
In that script you can do whatever you want: check the value of other fields and exit the script if it's the case, check who the user is etc and also toggle the field value to be not(fieldvalue). End the script with a commit records/requests and you're happy.
siplus Thanks! I do believe that will work.
Thanks again everyone for the help, I really appreciate it.
EDIT: I realised another way of solving my problem...
While I couldn't ever prevent the user from changing the Checkbox, I could make the Checkbox become invisible (and unclickable) via Make Object Invisible section of its data tab.
I put a text box behind the checkbox, displaying the value I wanted to display while the Checkbox was invisible.
So: when the user is to be prevented from changing the Check box, the Checkbox becomes invisible, the text box behind it displays the locked value, and any clicks on that text box result in no change to the actual value of the Checkbox. to the user, it looks like a locked Checkbox, even though the actual Checkbox was hidden.
Two weird things I learned about Filemaker through this:
1: Script Triggers don't seem to work on Boolean Checkboxes.
2. If I put a graphic box over the top of a checkbox, to hide the checkbox, users can still click on that graphic box and activate the Checkbox underneath it.