3 Replies Latest reply on Oct 17, 2013 6:42 AM by philmodjunk

    "Disable" a button after it is used

    NormD

      Title

      "Disable" a button after it is used

      Post

           I know this has come up in the forums before but I can't seem to find a definitive answer that works. I'm sure it's Conditional Formatting with a formula that will, "Make the button text grey after you select it". I just can't get the right formula. I've included a screen shot of the button, showing the finished result. Because this database is for many people, I want to indicate this action has already been performed and is now greyed out. I apologize if this has already been answered, but I just couldn't find one with a well explained formula. Thanks.

            

      Button_eg.jpg

        • 1. Re: "Disable" a button after it is used
          philmodjunk

               Am I correct that clicking the button inserts a number and a return at the beginning of the description? and that you have no return characters in the field until this script is performed?

               Frankly, this looks like data that should be entered in a separate field, but the following test will detect the presence of that added number in the description field if my assumptions are correct:

               ValueCount ( YourTable::Description ) = 2

               But using this in a conditional format to grey out the button only makes the button look disabled. It will still perform a script when clicked. You'll need to add an If step with the same test at the beginning of the script so that it can exit without doing anything if the buttons was clicked previously.

          • 2. Re: "Disable" a button after it is used
            NormD

                 PhilModJunk, your assumptions are correct. And yes, the data the button adds is in a separate field... as you can see in my screen shot. Also in my screen shot I wanted you to see that your solution worked perfectly! I never thought of using "ValueCount"

                 Thanks again.

                 This has had me puzzled for the last two weeks!

            • 3. Re: "Disable" a button after it is used
              philmodjunk
                   

                        And yes, the data the button adds is in a separate field...

                   My concern is that you are adding this data to the SAME field, (inserting the code string and the description in the same field). I would not do this unless it were unavoidable as it is a more complex way of working with this data than is strictly necessary in most cases.