softpac Posted January 15, 2007 Posted January 15, 2007 Hi I have a field on my layout that has the control style "checkbox set" with a value list "1". The field is mapped to a text field in the database. When the checkbox is "ticked", I notice the value in the field in the table (looking at it from another layout where the control style is edit box), I noticed the value is a space, followed by a return char then 1. Looks like this: " 1" (without the quotes of course) Why is that? I was expecting a "1" only if ticked an "" if unticked.
Lee Smith Posted January 15, 2007 Posted January 15, 2007 (edited) Since the checkbox is base on a value list, go to the source of it, and check that entry. If it turns out that the space is there, then you will need to replace the old value with the new. Lee Edited January 15, 2007 by Guest
LaRetta Posted January 15, 2007 Posted January 15, 2007 (edited) The value list will probably look like (blank line) 1 But in addition (and even if the value list looks right), you now have data to clean up. I suggest you perform find for 1, place your cursor in the field and run Replace Field Contents by calculation and just put a 1 in the calc box. Do so when not shared. And Replace Field Contents can't be undone so back up first. UPDATE: Some say checkbox shouldn't be used for one value but I disagree. A single checkbox with words "Customer notified" is very clear. And checkboxes look better than radio buttons; particularly on Windows. Radio buttons are UGLEEEE. Edited January 15, 2007 by Guest Added update
softpac Posted January 15, 2007 Author Posted January 15, 2007 Thanks for your help. Maybe the problem I am experiencing is because I am not using FM correctly. What I want is a boolean type data field. Should I define a text or number field? Should I use 0 (return char) 1 in the value list or False (return char) True? (or something else) I don't want whatever is entered in the list displayed on the layout, as a I have label for that, which is in fact a question (eg. Do you get water delivered to your office work place?) What is the fe facto standard among FM experts for implementing boolean type fields?
LaRetta Posted January 15, 2007 Posted January 15, 2007 Well, I wouldn't know about FM experts but I mostly use boolean number field. I use generic value list called Select containing only a 1. Attach Select VL to the number field. If your checkbox field is 16 px high, change the width of it to 16 px as well. The label '1' will disappear and you can easily add your own label. There are additional benefits to having the field NOT be empty such as using in joins. So we need a 0 to 'actually' be in the field if not one (instead of null result). Establish field Options and Auto-Enter by calculation something like: checkbox * 1 UNCHECK 'Do Not Evaluate if all referenced fields are empty' in the calc box and UNCHECK 'Do Not Replace Existing Value' in Auto-Enter tab. This will toggle 1/0 on the field - that 0 doesn't have to be in the value list at all. In fact if it *is* in the value list then your single checkbox will list BOTH values (not right). So instead, control the 0 in your Auto-Enter directly on that checkbox field. There are many sweet toggle methods - they are fun and diverse. Just anything simple which reverses 0/1. Abs() is cute here. It also increases field-formatting options. Using Field Control > Number Format and boolean, you can display that '1' as a field (in other layouts than the checkbox view) but have the field display TEXT; be it Yes, Done etc. :^) The boolean text-allowance is sickly limited (I think 7 characters) but nonetheless useful in lists, just displaying Yes or No or Done text. This value list and technique can be attached to many different toggle number fields for 'checking' off items (in List view) and can also easily have field entry (in Browse) removed in Field Control Behavior and script attached to 1) set the field with the toggle and 2) run some script. Toggles are great that way. LaRetta
softpac Posted January 15, 2007 Author Posted January 15, 2007 Thanks LaRetta. Implemented your technique as described in the 1st two paragraphs of your post. But you lost me on the third! Using Field Control > Number Format and boolean, you can display that '1' as a field but have the field display TEXT :^) Under field/control, the options are Edit Box, Drop Down List, Checkbox Set, Radio Set, Calendar Icon etc. I don't see a number format and boolean.
LaRetta Posted January 15, 2007 Posted January 15, 2007 I mis-spoke. : Right-click only - the number format is at the top. LaRetta
softpac Posted January 15, 2007 Author Posted January 15, 2007 Aaaahhhh! I get it now - cool. Thanks so much. :
arjayefem Posted April 5, 2009 Posted April 5, 2009 (edited) ....... put in it's correct place Edited April 5, 2009 by Guest
Recommended Posts
This topic is 6087 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