A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Make URLs



 
 
Thread Tools Display Modes
  #1  
Old December 30th, 2009, 08:03 PM posted to microsoft.public.access.queries
EllenM
external usenet poster
 
Posts: 206
Default Make URLs

Hello,
I'd like to make urls by concatenating three fields. The urls will look like
this:
a href='[!--$ssLink("ucm194578.htm#_Toc230422666")--]'Introduction/a


I think it should constructed like this:
Link: "a href='[!--$ssLink(""ucm" & [UCM] & ".htm#_" &
[tr]&"")--]'"&[Field12]&"/a", except that I get an error message that
there's too many closing parentheses.

Thanks in advance for your help.

Ellen
  #2  
Old December 30th, 2009, 08:30 PM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default Make URLs

EllenM wrote:
Hello,
I'd like to make urls by concatenating three fields. The urls will
look like this:
a
href='[!--$ssLink("ucm194578.htm#_Toc230422666")--]'Introduction/a


I think it should constructed like this:
Link: "a href='[!--$ssLink(""ucm" & [UCM] & ".htm#_" &
[tr]&"")--]'"&[Field12]&"/a", except that I get an error message
that there's too many closing parentheses.


Is this a message from Access? Or from the application that's rendering
these anchor tags?

--
HTH,
Bob Barrows


  #3  
Old December 30th, 2009, 08:37 PM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default Make URLs

EllenM wrote:
Hello,
I'd like to make urls by concatenating three fields. The urls will
look like this:
a
href='[!--$ssLink("ucm194578.htm#_Toc230422666")--]'Introduction/a


I think it should constructed like this:
Link: "a href='[!--$ssLink(""ucm" & [UCM] & ".htm#_" &
[tr]&"")--]'"&[Field12]&"/a", except that I get an error message
that there's too many closing parentheses.

Thanks in advance for your help.

Ellen


The problem is you failed to excape the literal quote before the closing
parenthesis. Unless you escape the quote, Jet treats it as a delimiter.
You escape a special character by doubling it. The expression should
look like this:

Link: "a href='[!--$ssLink(""ucm" & [UCM] & ".htm#_" &
[tr] & """)--]'"&[Field12]&"/a",

PS. It helps readability to put spaces around your operators
(specifically the ampersands)
--
HTH,
Bob Barrows


  #4  
Old December 31st, 2009, 01:32 PM posted to microsoft.public.access.queries
EllenM
external usenet poster
 
Posts: 206
Default Make URLs

Thanks, Bob. Looks like you tripled the quotes before the closing
parenthesis. But it worked and for that I'm grateful.

Ellen

"Bob Barrows" wrote:

EllenM wrote:
Hello,
I'd like to make urls by concatenating three fields. The urls will
look like this:
a
href='[!--$ssLink("ucm194578.htm#_Toc230422666")--]'Introduction/a


I think it should constructed like this:
Link: "a href='[!--$ssLink(""ucm" & [UCM] & ".htm#_" &
[tr]&"")--]'"&[Field12]&"/a", except that I get an error message
that there's too many closing parentheses.

Thanks in advance for your help.

Ellen


The problem is you failed to excape the literal quote before the closing
parenthesis. Unless you escape the quote, Jet treats it as a delimiter.
You escape a special character by doubling it. The expression should
look like this:

Link: "a href='[!--$ssLink(""ucm" & [UCM] & ".htm#_" &
[tr] & """)--]'"&[Field12]&"/a",

PS. It helps readability to put spaces around your operators
(specifically the ampersands)
--
HTH,
Bob Barrows


.

  #5  
Old December 31st, 2009, 01:58 PM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default Make URLs

Well, to be strict, I doubled the quote that was intended to be interpreted
as a literal quote to be included in the string being built, and left the
delimiting quote alone. So yes, it does appear as if I tripled the quote,
but that was not the intent.


EllenM wrote:
Thanks, Bob. Looks like you tripled the quotes before the closing
parenthesis. But it worked and for that I'm grateful.

Ellen

"Bob Barrows" wrote:

EllenM wrote:
Hello,
I'd like to make urls by concatenating three fields. The urls will
look like this:
a
href='[!--$ssLink("ucm194578.htm#_Toc230422666")--]'Introduction/a


I think it should constructed like this:
Link: "a href='[!--$ssLink(""ucm" & [UCM] & ".htm#_" &
[tr]&"")--]'"&[Field12]&"/a", except that I get an error message
that there's too many closing parentheses.

Thanks in advance for your help.

Ellen


The problem is you failed to excape the literal quote before the
closing parenthesis. Unless you escape the quote, Jet treats it as a
delimiter. You escape a special character by doubling it. The
expression should look like this:

Link: "a href='[!--$ssLink(""ucm" & [UCM] & ".htm#_" &
[tr] & """)--]'"&[Field12]&"/a",

PS. It helps readability to put spaces around your operators
(specifically the ampersands)
--
HTH,
Bob Barrows


.


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.