do a search for "Visibility Trick" on this Forum or on the Web.
There are two ways of disabling buttons.
The first is to hide the button completely. The only way to do this in FileMaker Pro is to place the button in a portal whose relationship is controled by some field, typically a global, or to place the button on a tab control and set the tab control to another tab to hide. Both these techniques require scripting to work and likely will require script triggers.
The second is to give the button a different colour scheme through conditional formatting so that users understand the button's functionality is not available. This is similar to what you have done, only your should not hide the button completely. To complete this approach, the script the button triggers also needs to look for the conditional formatting's trigger so that it knows to abort instead of performing its code. This most often take the form of an If statement skipping the entire code.
Hope this helps!
There's a trick I use that's a variation on the conditional formatting technique.
Instead of hiding the button, I just disable it. I use conditional formatting to change the button's text color to grey. Then I modify the button's script so that the first script step uses an If statment and the same condition so that nothing happens if the button is clicked. I also put any tool tip text inside an If function that makes the same test so any tool tip does not pop-up if the button is in its "disabled" state.
Yeah, still get the hand and the button still highlights when clicked--both details I'd like to disable, but less of an issue since the button remains visible.
I call this nifty trick "the rubber button." This allows you to grant conditional access to a button based on the user's privilege set.The button script will check user's privilege set name. If this priv set of the current user is not authorized to use that button, then the script will bounce them out of the button and into a field. Example:
Button script: If (get current privilege set name) = "NotAllowedGroup1"
Go to Field1
Show custom dialog: "You do not have access to this button."
Execute actual button script (i.e. the "Open Employee Table" button will take the authorized user to the Employee Table).