You are probably looking for "Replace Field Contents"
Just remember it will replace the contents for everything in your found set. I think the best way to do this would be to define a calculation that should apply to the whole data set. This will stop you from having to do numerous finds.
And it is a good idea to save a copy of your file just before you start using Replace Field Contents. This tool makes changes that cannot be reverted so that back up copy can let you throw out the current file and start over if you make a mistake and screw up a bunch of records in the process.
I think he do not want to replace the contents of existing field rather he wants "and had an inkling to add an extra field to it." This extra field will be empty for all 2000 records. He wants to fill it not by going one by one to all fields but need a script to fill all of them on some conditions of existing records. Philmodjunk can surely help him to write a script but first rickcw have to mention on what conditions "batches" he want to fill the empty new record. If it is just one value for all then it might be a global field so no need for any script.
He wants to fill it not by going one by one to all fields but need a script to fill all of them on some conditions of existing records.
Replace Field Contents is more versatile than you may think; it lets you choose between a fixed value, a serialized value, or the result of a calculation, so usually there is no need to write a script.
I've tried your suggestion but I can't seem to get it to work. Maybe it's the wrong syntax I'm using? I go to the Replace Field Contents option on the menu and try using a calculation. It's a classical music database and my new field is called Period; its value list includes "Renaissance", "Baroque", "Classical", "Romantic" etc.
What I want to do, for example, is to give all my recordings by Handel the value "Baroque" in the new Period field. I have gone to Replace Field Contents, specified the Period field and then selected Calculation. I then double-clicked on the If (test; result 1; result 2) operator and rewrote it to say 'If (Composer = Handel; "Baroque"; "")' hoping that it will enter Baroque in the Period field on each record with Handel in the Composer field and leave the Period filed blank otherwise. But nothing happens!
It really depends on how composer is filled out. I suspect you have a full name in the composer field. The calculation you are using is only looking for an exact match of "Handel" in composer. So if you have the composer as " George Frideric Handel" then "Baroque" would not go into the field. I think your calculation should probably be a case instead of an if statement:
//**and so on**//
This would achieve what you are looking for BUT this isn't the best way to do it. A better method would be move away from a flat design and create a join table for a composer to musical period. Hope this helps.
Thanks for all your help, I really appreciate it. As I implied in my
original post, I'm a bit of a novice where FileMaker is concerned but I
think I'll have a go at your Table suggestion.
Thanks for the tip!
check the mention of a Composer table, above. Ideally, you'd also have a Period table. My suggestion is to start there; then figure out how to "replace" the new Composer foreign key. You won't find it too difficult. It'd make your solution much more tidy.
I took your advice and created a separate Table for Composer and Period,
with Composer as a 'match field'. This way I can get the Period field on
the main database filled in automatically for all new records, using the
'Look-Up' function, which is good.
I'm still struggling to find a way to automatically enter the Period field
data for the records that already exist, though. Am I missing something
obvious? Many thanks in advance for your help.
Almost there! Sounds like you just need to relookup the records.
Go to your composers layout.
Show all records.
Enter into the match field. <<very important>>
Click records at the top and Re-lookup Field Contents.
Give it time to work and you should be golden.
Or you can just put the related field on the layout and you will be able to see the results.
Almost 2,000 fields filled in a matter of a few seconds! Thanks a million, OCDilla.