Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Uncheckable checkboxes...


Obfuscator

Recommended Posts

Good day, all.

 

Say, I'm working with a set of two sets of checkboxes (one with twelve checkboxes, one with eight) that have proved a bit of a bother. Whenever I attempt to check the last two checkboxes of each set, the checkmark does not appear, only flickers. Pen settings are all as they ought to be (black pen color, nonzero pen width, etc.). Fill settings are fine as well.

 

I've even tried to create a new field and a new list of checkboxes but the same problem occurs. However, in two other fields with checkboxes, this problem does not occur. Bother!

 

Any solutions? Thanks in advance.

 

-Obfuscator

 

FileMaker 9.0.3

Mac OS X 10.5.1

Link to comment
Share on other sites

What are the values in your value list that you are trying to select?

 

 

What type of field have you formatted with the value list?

Link to comment
Share on other sites

  • 3 weeks later...

How can I place the value of boxes checked in a list into another field? I can get the radio boxes to do it but have not figured the checkboxs out yet.

Link to comment
Share on other sites

The "value of boxes checked" is quite simpy the value of the field. That's what's in the field. The checkbox value list is simply a formatting option, a way of displaying what's in the field.

 

If you want to set some other field Field X to the value of all checked-off values in a checkbox-formatted field Field Y, just set Field X to Field Y.

Link to comment
Share on other sites

Please bear with me, I am a little confused.

Given that I have 4 check boxes. Each one the name of a state. If all of the boxes are checked. How does filemaker recongize the box is marked (bolean?) and then write the script to transfer that data to another field.

Thank you for taking the time to help me I really appreciate it.

 

Manny

Tech teacher

Link to comment
Share on other sites

Let's say that your field, when formatted with a checkbox value list, looks like this:

 

[x]Georgia [x]South Dakota

[x]Oregon [x]Massachusetts

 

If you put another copy of the very same field right next to it, but format it as a regular "edit box" field, you will see that THIS is what is actually, literally, in the field:

 

Georgia

South Dakota

Oregon

Massachusetts

 

 

All of the checked-off values are IN the field, with a hard return separating each value from the other.

 

NOW: would you want to transfer ALL of those values, just like that, to another field? Then do as I said:

 

Set Field [Field Y, Field X]

 

done.

 

If that is NOT what you meant, you are going to have to explain a bit more clearly what it is that you want to end up in the other field.

Link to comment
Share on other sites

I only want the boxes that are checked to move over to the other field. I understand the set field function, its how to do I write the script to know what boxes are checked to tranfer and tell it to transfer over the uncheck. Trying my best to explain.

Link to comment
Share on other sites

The unchecked values are NOT in the field. Are you saying you want to move over the values that are MISSING (unchecked)? That's not what you originally said.

 

=== edit / correction: I see it's also not what you meant to say. Wish I'd figured that out before I typed what's below. I'm leaving it in case some day you DO want to do that. For now skip to the next post ===

 

 

OK... so if your field looked like this:

 

[_]Georgia [x]South Dakota

[x]Oregon [_]Massachusetts

 

and you wanted to place, in Field X, the values that are NOT checked (Georgia and Massachusetts), you can't obtain it from the field — those values are not IN the field and they are not OF the field, they are merely how the field is FORMATTED. Where you get those values is from the VALUE LIST that the field if formatted with.

 

ValueListItems (Get(FileName); "StatesCheckBoxVL")

 

returns these values:

 

Georgia

South Dakota

Oregon

Massachusetts

 

Now you want to remove from that list the values that are checked in the current record's field (Field Y), leaving you with the unchecked ones. There's a nice little custom function called ZapValues, but if you don't have FileMaker Advanced a custom function would not be of must use to you. But you indicated that you are using a script anyhow, so:

 

Set Variable [$CheckedValues, "¶" & YourTable::Field Y & "¶"]

Set Variable [$VLItems, "¶" & ValueListItems (Get(FileName); "StatesCheckBoxVL") & "¶"]

Set Variable [$Pos, 1]

Comment ["You're wondering why the returns at start and end, aren't you? When you're looking for matching values using PatternCount(), the word 'crabapple' contains the word 'apple'; but ¶crabapple¶ does not contain ¶apple¶. It also means every value is sandwiched between two hard returns, which is convenient as you'll see in a minute"]

Comment ["Now we're going to loop and assemble a list of values that are in the value list but NOT in the field. Those are the unchecked values."]

Loop

.. Set Variable [$ValueToCheck, Middle ($VLItems, Position $VLItems, "¶", 1, $Pos)+1, Position ($VLItems, "¶", 1, $Pos+1)-Position ($VLItems, "¶", 1, $Pos)-1)]

.. Comment ["In other words the part of $VLItems lying between one ¶ and the next ¶; $Pos starts out being 1 and gets incremented as you'll see shortly."]

.. If [PatternCount ($CheckedValues, "¶" & $ValueToCheck & "¶")=0]

.... Set Variable [$UncheckedValues, $UncheckedValues & Left ("¶", Length ($UncheckedValues)) & $ValueToCheck]

.... Comment ["In other words I set it to what it already is, so as to keep existing values; if there is, in fact, anything IN it already, I add a hard return, otherwise the length of it as it already is is 0 so the hard return doesn't get inserted; and then I add the current value"]

.. End If

.. Set Value [$Pos, $Pos + 1]

.. Exit Loop If [$Pos + 1 > PatternCount ($VLItems, "¶")]

End Loop

Set Field [YourTable::Field X, $UncheckedValues]

 

 

The result should be that Field Y looks like this:

 

Georgia

Massacnusetts

 

 

is that what you want?

Link to comment
Share on other sites

 

OK I reread your post #8 and I see that no, that is NOT what you want to do. You just want to move over the values that ARE checked. My fault on the reading comprehension thing.

 

As I said: the unchecked values are NOT IN THE FIELD. That means when you do this:

 

Set Field [YourTable::Field Y, YourTable::Field X]

 

 

... the only values that get moved are the checked-off values.

Link to comment
Share on other sites

WoW! Thank you very much. I believe you have answered everything I need.

I printed out your instructions and will save that in my note book. Thank you, you have set me on the right path.

Link to comment
Share on other sites

WOW!!!!!Thank you very much. I believe you have given me a lot to work with and it will answer my problem. THank you again. If I ever get a project too big for me, I know who I want get to work with. Thank you again.

 

Manny

Link to comment
Share on other sites

Welcome aboard. There are a lot of helpful people in here, and at some point, if you stick with FileMaker, you'll find yourself answering someone else's questions!

Link to comment
Share on other sites

Well I have been with Filemaker since version 5, I have 9 now. Just got my fist job, made a nice commission. I have been creating curriculum software.

My first national write up at http://filemaker.com/solutions/customers/stories/200021.html

 

But I want to expand knowledge base to internet applications. E-learning is the future. Newest program on the block is Moodle. Free open source.

Link to comment
Share on other sites

I got on board with FileMaker Pro 1.0 (the earlier versions listed at left I acquired after-the-fact just to have 'em and to see what was possible back in the day); things really took off for me under FileMaker 2, though, that's when I first felt like I could make this app do anything :)

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use