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.
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"
This has had me puzzled for the last two weeks!
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.