Rich S Posted October 6, 2014 Posted October 6, 2014 I'm ready to pull the trigger, just don't know which ones! I have a text field with a value list of the following checkbox'd choices: All Average Count Std Dev Total I want it so when a user ticks All it nulls the other values (clears the field, save for All), but if a user changes his mind and wants to use any of the other value(s), when they click the other value(s) I want All to be untucked/cleared. It sounds simple enough--and it probably is--just that I'm having trouble wrapping my head around which script trigger to use for when; when I use OnObjectModify and PatternCount to test for "All", I can get it to work so when ticking All it clears the field, but I'm running into trouble with the second half to he problem. TIA for your help!
doughemi Posted October 6, 2014 Posted October 6, 2014 For the second half, try If [ValueCount ( YourTable::checkbox ) >1 and ValueCount ( FilterValues (YourTable::checkbox ; "All" ))] Set Field [YourTable::checkbox; Substitute( YourTable::checkbox; FilterValues ( YourTable::checkbox ; "All" ); "")] End If
Rick Whitelaw Posted October 6, 2014 Posted October 6, 2014 Why not use Radio Buttons instead of checkbox?
eos Posted October 7, 2014 Posted October 7, 2014 I want it so when a user ticks All it nulls the other values (clears the field, save for All), but if a user changes his mind and wants to use any of the other value(s), when they click the other value(s) I want All to be untucked/cleared. Try this auto-enter calc: Let ( [ allTypes = "Average¶Count¶Std Dev¶Total" ; typesIn = FilterValues ( Self ; allTypes ) ] ; Case ( RightValues ( Self ; 1 ) = "All¶" or ValueCount ( typesIn ) = ValueCount ( allTypes ) ; "All" ; typesIn ) )
Rich S Posted October 7, 2014 Author Posted October 7, 2014 Thanks for elegant solutions, guys! Both worked like a charm so I'll pick one and go with it. Why not use Radio Buttons instead of checkbox? Good question! I'm creating a switchboard for report and list generation so I want users to be able to pick which elements they want to include in reports that require calculation, so some may be interested in having an average and count, but nothing else; others, all; others, totals and standard deviations, and so on.
Recommended Posts
This topic is 4086 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