I have a field that is a auto-enter data = 0. This field is called CV and the user is going to check one checkbox to change this value to = 1. How can I do this, and it needs to look like this:
Use a script. Here's some steps:
1) Create a value list with one value (1).
2) Set the field to display using checkboxes and that value list.
3) Write a script that toggles the value, and attach it to the field as a button. Might look something like this:
If [ yourTable::CV = 0 ]
Set Field [ yourTable::CV ; Value: 1 ]
Set Field [yourTable::CV ; Value: 0 ]
As an aside, you can make your life easier by not setting the field to auto-enter a 0. If it's empty, then all you have to do is steps 1 and 2. (An empty field will still evaluate as "False" for purposes of a Boolean calculation.)
Thanks Mike. I trying to delete the auto-enter 0 and only do step 1 and 2, then the result gets 0 if it is not checked and a "?" when it is checked:
And it looks like this in the layout:
It looks like that's table view. You can't apply checkboxes in Table view. So the only conclusion I can draw is that there was already a 0 in that field, and when you checked the box, it added a 1 - which a number field can't handle.
Whenever you set a field to show as a checkbox set, it's still a text field. The values are stored in a return delimited list, and old values are not removed just because you check or uncheck the box. If you look at the field without the checkboxes applied, you'll see the actual data. I'm guessing it looks something like this:
So if you want to avoid the script, you'll need to remove all the "0" values from the existing data.
Here are a demo file with two ways to do it. With and without 0 (zero), both without scripting.
With best regards Magnus Fransson.
Both solution very nite fran55on. I choosed to go for CV1 solution, very much that I had in mind. How did you managed to remove the 1 beside the checkbox?
Just made it "to small". :-)
hehe, okey nice. Thanks alot fran55on
Retrieving data ...