TIPS & TRICKS
Replace Field Contents
Compiled by Stuart Gripman
Here's how to change the values of one field in a bunch of records
simultaneously.If you use
a database long enough, you're bound to encounter a situation where
you need to change the values of one field in a bunch of records
at the same time. If you've ever gone from record to record making
the same change over and over again, surely you've thought there
must be a better way. There is.
The Replace command is a powerful
tool for updating many records at once. Effectively, Replace deletes
the contents of the currently active field and inserts the data
of your choosing for every record in the found set. It's important
to exercise caution when performing a Replace. It always operates
on the entire found set of records -- and you can't reverse it by
using "Undo." I routinely save a back-up copy of my database before
a Replace. It's the only way to go back if you make a mistake.
Replace with current contents
Replace has three methods of operation. The first Replaces the field
data in all records to match the current record's value. Click into
a field and choose "Replace Field Contents..." from the Records
menu. If you click on "Replace," all the records in the found set
will now contain the same value as the active record.
Replace with serial numbers
This option lets you apply serial numbers to the Replace field.
The initial and increment values must be integers. If the field
you're replacing in is defined as a serial number field, the "Update
serial number in entry options" checkbox will be available. Checking
it will update the field's serial number settings to ensure that
records you create after the Replace action will have appropriate
serial numbers. One word of caution: No matter which record you
invoke the Replace from, the initial value will be applied to the
first record in the found set.
Replace with calculated result
Here lies the true power of Replace. Choosing this option opens
a standard calculation dialog box. If you can calculate it, you
can Replace with it. One very common application is to append information
to an existing field. Say you have a notes field and you want to
add "Sent Summer 2006 Card" to the notes of each record without
overwriting the existing notes. The calculation below would do the
job:
notesField & "ΆSent Summer 2006
Card"
This calculation simply retains
the existing contents of the notes field and adds the text on a
new line at the bottom.
Let
ARCHIVE-CD show you
how we can help you streamline
your work environment
and expand your possibilities.
Call 800-323-1868 or visit www.archive-cd.com
|