ron G Posted March 1, 2011 Posted March 1, 2011 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
Raybaudi Posted March 1, 2011 Posted March 1, 2011 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 )
ron G Posted March 1, 2011 Author Posted March 1, 2011 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.
bruceR Posted March 1, 2011 Posted March 1, 2011 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.
ron G Posted March 2, 2011 Author Posted March 2, 2011 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?)
bruceR Posted March 2, 2011 Posted March 2, 2011 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.
Raybaudi Posted March 2, 2011 Posted March 2, 2011 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 ]
bruceR Posted March 2, 2011 Posted March 2, 2011 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.
Recommended Posts
This topic is 5015 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now