Adding text and text from other fields to create a new field

J

John Vinson

I have a field called photo. The field will contain the name of a file
"photo.jpg" There are two other fields with the persons first and last
name. I want to do the following; add the text
<a href="http://website.edu/assets/faculty_photos/" with the data already
in the field, followed by data in the fields, firstname, and lastname, to
produce the following:

<a href="http://college.edu/assets/faculty_photos/photo.jpg">Firstname
Lastname</a>

This field should NOT exist in your table; it should be calculated on
demand in a Query. Just use a vacant Field cell in the query
definition to concatenate the literal text with the field values:

LinkText: "<a href=""""http://college.edu/assets/faculty_photos/" &
[photo] & """">" & [Firstname] & " " & [Lastname] & "</a>"

(all on one line). The quadruple doublequotes are needed to insert a
doubleqote within a doublequote delimited string. This assumes that
the field [Photo] contains text like JanetHendren.jpg to show Dr.
Hendren's photo.


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top