March 1, 201114 yr I have a radio button on my layout. It indicates either "Member" or "Candidate". It works. In trying to provide for the eventuality that a user will hold the shift key and click both choices, I tried to trap with this code: But, even though this code worked in a SET FIELD command in other code, when I debug it and step through the code, it is IGNORED with my ELSE IF.... WAZ UP WITH THAT? Thanks
March 1, 201114 yr Hi no need to trap anything if you add this calculation into the auto-enter option ( always evaluate ) for that field: GetValue ( Self ; ValueCount ( Self ) ) ( holding the shift key does nothing )
March 1, 201114 yr Author Great idea. Thanks. But, since the radio buttons are sometimes 'set' by another button, I need a way to check their status (which is sometimes BOTH buttons). Hence, the ELSE IF code above.
March 1, 201114 yr Great idea. Thanks. But, since the radio buttons are sometimes 'set' by another button, I need a way to check their status (which is sometimes BOTH buttons). Hence, the ELSE IF code above. The other button CANNOT set the field to contain two values if the auto enter calc is set up as suggested.
March 2, 201114 yr Author Right. Which explains 'why' I can't use the autoenter calc. I just need a way to recognize when both buttons are pressed. I find it surprising that SET FIELD recognizes both buttons but ELSE IF does not. Weird. (Or am I missing something?)
March 2, 201114 yr Why do you want both options? It is a radio button; it is SUPPOSED to allow only one value. You are presenting conflicting information; are you saying that sometimes two values are allowed? And if so; then that is what checkboxes are for.
March 2, 201114 yr I need a way to check their status (which is sometimes BOTH buttons). Hence, the ELSE IF code above. Try: Else If [ ValueCount ( Members::gMem_Can ) > 1 ]
March 2, 201114 yr Right. Which explains 'why' I can't use the autoenter calc. I just need a way to recognize when both buttons are pressed. I find it surprising that SET FIELD recognizes both buttons but ELSE IF does not. Weird. (Or am I missing something?) You are missing something. Your else if statement is poorly constructed. If somebody shift clicks the radio buttons it will not have that warehouse full of returns that are contained in your calc. Secondly, your statement puts the values in only a single order and there is no guarantee users clicked them in that order. Raybaudi's metod is better.
Create an account or sign in to comment