Contatenate quote character

E

EllenM

Hello,
Using an update query, I'd like to concatenate a field named [link], so that
the end result looks like this:
<a href="[link]">.

Looks like the quote character needs some sort of escape character.

Thanks in advance for your help,
Ellen
 
J

John Spencer

You can concatenate in Chr(34) or you can use two quotes in a row whereever
you need one quote in the actual string. Any one of the following should work.

SomeString = "<a href=""[link]"">"

or
SomeString = "<a href="& Chr(34) & "[link]" & Chr(34) & ">"

or (this one uses two quotes to get one quote inside a begin string quote and
an end of string quote)
SomeString = "<a href="& """" & "[link]" & """" & ">"



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
E

EllenM

-- only need to omit the quotes around the field name:
SomeString = "<a href="& Chr(34) & [link] & Chr(34) & ">"
or
SomeString = "<a href="& """" & [link] & """" & ">"
works.

Thanks so much, John.
 

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