I have a YES / NO radio button on my layout. After doing a Find for all records with the button set to NO, I want to change them all to YES. Is there a way to do that in the standard interface or do I need to write a script to do that task?
You can change the value in one record and then use the REPLACE FIELD CONTENTS option to replace it for the others in the found set.
Hi, rbogdanoff (I'd address you by name, but I don't know what it is).
Yes, you can do this. The command is called Replace Field Contents (under the Records menu in Browse mode). In your case, you will want to set your cursor into one of the fields and do one of two things: Either change it to "Yes" and use Replace With: (as in the current contents), or use a calculation that simply says "Yes".
WARNING, WILL ROBINSON!!!
The Replace Field Contents command is FileMaker's nuclear weapon. It will change all the records as you specify them, and there is no undo. So if you're not 100% confident in your ability to handle this safely, make a copy of your database first.
As others have said, use the REPLACE FIELD CONTENTS command.
HOWEVER ... if you're using one record first to change the value, then using REPLACE, please be aware : clicking a radio button with choices (e.g. to change from NO to YES) will move you out of that field after the click. You need to move the cursor back to the field so that it's the active one when you choose REPLACE.
fmchris wrote: clicking a radio button with choices (e.g. to change from NO to YES) will move you out of that field after the click.
clicking a radio button with choices (e.g. to change from NO to YES) will move you out of that field after the click.
Sorry but that is not the case, fmchris. Selecting from radio button leaves the cursor in that field and you maintain possession. You can test it in several ways ... the simplest is to make your radio button selection then immediately hit DEL. The value disappears.
Selecting the radio button value then immediately running Replace Field Contents will work and, as Mike suggests, there is no undo so always back up before mass replacing data (and before most everything else too, LOL).
Thanks for the replies. It was as easy as I thought it would be, I knew about REPLACE FIELD CONTENTS but didn't know it would work for radio buttons.
Think of it this way: Radio buttons, checkboxes, etc., are just interface elements sitting on top of (typically) a text field. Pretty much anything you can do with a text field that's an edit box, you can do when it's set to radio buttons or checkboxes.
It's important to understand a few things, though:
1) You can click into a checkbox or radio button field and type (if you've checked "Allow entry of other values" in the Inspector) and the results will be shown, but not displayed. Ugly if you're not aware of it. In most cases, it's probably best not to allow other values because of this.
2) Values in fields with checkboxes are stored as a return-delimited list, with the values in the field in the order in which they were clicked (so don't count on them being in the order they appear in the value list). If you want to search a field in which a checkbox set has been used for input, you'll need to parse out the values separately.
Retrieving data ...