Globally change part of a field

  • Thread starter Thread starter JWCrosby
  • Start date Start date
J

JWCrosby

I have a text field that holds the file location of a picture. The content
looks like this:

H:\Access Data\Personnel Pictures\picturefile.bmp

The "picturefile.bmp" is different for every record. Everything preceding
it is identical in all records.

I've moved the folder with all the pictures to a new location and need to
update this field to the following:

S:\Everyone\Member Database\Personnel Pictures\picturefile.bmp

So basically, I need to swap out "H:\Access Data" for "S:\Everyone\Member
Database" in every record.

How so?

Thanks in advance.

Jerry
 
Use the Replace function in an update query.
Replace([YourField], "H:\Access Data", "S:\Everyone\Member Database")
 
I have a text field that holds the file location of a picture. The content
looks like this:

H:\Access Data\Personnel Pictures\picturefile.bmp

The "picturefile.bmp" is different for every record. Everything preceding
it is identical in all records.

I've moved the folder with all the pictures to a new location and need to
update this field to the following:

S:\Everyone\Member Database\Personnel Pictures\picturefile.bmp

So basically, I need to swap out "H:\Access Data" for "S:\Everyone\Member
Database" in every record.

How so?

Thanks in advance.

Jerry

Update the field to

Replace([fieldname], "H:\Access Data", "S:\Everyone\Member Database")

This is a good example of why it's usually preferable to store the filename
and the path in different fields - they may indeed change independently of one
another.


John W. Vinson [MVP]
 
Back
Top