You have two options:
- You can use Replace Field contents from the records menu (or in a script)
- You can create a looping script that steps through each record in succession to update a series of records
Replace Field Contents is a very powerful tool that can change a lot of records. It has many options, so I would read up on it in the help file and test it on a copy of your file until you're confident you've got it working for you. It's also not a good choice in a networked environment. If another user starts to edit one of the records you want to update, this tool will not update that one record and then reports that "1 records was not updated..." and there is no simple way to tell which record was skipped. Thus, it is best used on single user files or under circumstances when you are absolutely sure that no other users might lock one of the records you need to update.
With a looping script, it takes more effort, but you can check for locked records as you go and devise a means to handle that problem.
Go To Record [First]
Set Field [yourtable::Fieldname, Your update data/expression]
If [get (lastError) ≠ 0]
#add code here to handle locked records (build a list of skipped records, stop and display an error or ....)
Go To record/request/page [Next, Exit after last]
First I am the only user, so no problem with locked records.
How can I select one of the values in the value field.
Using either option I cant get it to replace contents of field, (presumably because it is a Value field).
Have tried using "Sent" in the calculated result but doesnt work.
Forget that Phil, If I change the first record to Sent, then using Records - replace, it will change the rest to suit.
I was hoping to use a script,soo I dont have to remember how to do this, but the above works fine.
Thanks (once again) for your help.
You can use replace field contents in a script. You can also use the specify calculation option to specify the value you want stored in your field.
Be careful about this detail: If you have a check box format with mutliple values, your replace field contents will overwrite existing selections with your specified value.
Thus a field with "Sent" and "Overdue" check boxes selected will read just "sent" after you do a replace field contents with "sent" specified.
I have dropdown boxes with "Y", "N" and "Sent" options.
If I use a script try to replace with sent it doesnt work. I get "0" instead.
Is it because its a drop down box that it doesnt work?
I am using "Orders::Reminder = "Sent" in the specify box.
Just put "sent" (quotes included) in the specify calculation dialog.
Orders::Reminder = "Sent"
Is a calculation that will return either true (1) or false (0) depending on the current value of Orders::reminder. That's why you're getting a number instead of the text.
Thanks Phil, that sorted it.