×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Script to check a checkbox

Script to check a checkbox

Script to check a checkbox

(OP)
How would I script filemaker to check a given checkbox?

RE: Script to check a checkbox

ckier,

In Filemaker, a checkbox is is really just a regular field formatted to show a checkmark next to selected values.  So for instance, if your field contains the values "Yes" and "No", to script the checking of the box what you need to do is enter the value of either "Yes" or "No" into that field.  That is typically done using SET FIELD:

Set Field [TableName::FieldName; "Yes"]

This will checkmark the "Yes" value.  To remove all checkmarks you simply clear the value from the field:

Set Field [TableName::FieldName; ""]

You should be aware that if you entered the text "Maybe" into the field, neither YES or NO would be checked nor would you be able to see the value MAYBE.  The value list that you have assigned to that field must contain all valid values that you want to display.  In this case you would need to have YES, NO, and MAYBE as values.

-Striker

RE: Script to check a checkbox

(OP)
thanks so much for your help. The script worked perfectly. My only problem is that this step is part of another script that finds a bunch of records and then checks off the checkbox on all of them and my script only checks off the first record. I tried the select all command before set field command but that didn't do anything. How can I incorporate a select all records command.

RE: Script to check a checkbox

To change more than one record you would use the REPLACE FIELD CONTENTS command.  This will replace (or set) the content of your field across all records of THE ENTIRE FOUND SET so PLEASE USE WITH CAUTION.  If you make a mistake you will be changing all records in the found set which could possibly be every record in your database!

What you want to do is specify the proper Target Field and then choose "Replace with calculated result."  The calculation is simply the literal text string "Yes" or whatever you want to checkoff.

Again, always use this command with extreme caution as it can do mucho damage in a heartbeat and there is no undo.  Whenever I script this command I like to test for proper conditions (like a reasonable found count) and not proceed unless all is well.  I also like to include a warning message to the user (Custom Dialog) and have them confirm that they actually do want to proceed.

-Striker

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close