SteveL13
asked on
How design query to update field values in a table
I have a table with several records that have the following examples in a field named "Image":
B:\Dropbox\Business Documents\Database\Databas e Images\Tree.jpg
B:\Dropbox\Business Documents\Database\Databas e Images\Football.jpg
B:\Dropbox\Business Documents\Database\Databas e Images\Rainbow.jpg
B:\Dropbox\Business Documents\Database\Databas e Images\Flower.jpg
But I want to create an update query that will chance the text in the field to be a lookup from a table and the last part of the existing field value.
So if the lookup value is...
= DLookup("[ImageDirectory]" , "tblDatabaseSetup")
Then I want the new field values to read:
The Looked Up Value\Tree.jpg
The Looked Up Value\Football.jpg
The Looked Up Value\Rainbow.jpg
The Looked Up Value\Flower.jpg
In other words the field should display the looked up value and keep the last part of the existing value for example Tree.jpg
How can I create this update query?
B:\Dropbox\Business Documents\Database\Databas
B:\Dropbox\Business Documents\Database\Databas
B:\Dropbox\Business Documents\Database\Databas
B:\Dropbox\Business Documents\Database\Databas
But I want to create an update query that will chance the text in the field to be a lookup from a table and the last part of the existing field value.
So if the lookup value is...
= DLookup("[ImageDirectory]"
Then I want the new field values to read:
The Looked Up Value\Tree.jpg
The Looked Up Value\Football.jpg
The Looked Up Value\Rainbow.jpg
The Looked Up Value\Flower.jpg
In other words the field should display the looked up value and keep the last part of the existing value for example Tree.jpg
How can I create this update query?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect as always. Thank you!
You are welcome. Glad I could help.
Public Function get_imgpath()
get_imgpath=DLookup("[Imag
End Function