About
Pricing
Community
Teams
Start Free Trial
Log in
SteveL13
asked on
2/25/2015
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?
Microsoft Access
4
1
Last Comment
Dale Fye
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dale Fye
2/25/2015
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
bonjour-aut
2/25/2015
I recommend to do a Public Function and use it in the SQL for the query
Public Function get_imgpath()
get_imgpath=DLookup("[Imag
eDirectory
]", "tblDatabaseSetup")
End Function
SteveL13
2/25/2015
ASKER
Perfect as always. Thank you!
Dale Fye
2/25/2015
You are welcome. Glad I could help.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Public Function get_imgpath()
get_imgpath=DLookup("[Imag
End Function