PC Review


Reply
Thread Tools Rate Thread

Need help with concatenation function

 
 
EllenM
Guest
Posts: n/a
 
      21st May 2010
Hello,
I've found a wonderful concatenation function at
http://www.mvps.org/access/modules/mdl0008.htm. It, however, separates the
concatenated values with semicolons when I'd like them to be separated with
"<br />"s.

For instance, instead of "Value1; Value2; Value3", I'd like "Value1<br />
Value2<br /> Value3<br />".

Thanks in advance for your help.

Ellen

 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      21st May 2010
EllenM wrote:
> Hello,
> I've found a wonderful concatenation function at
> http://www.mvps.org/access/modules/mdl0008.htm. It, however,
> separates the concatenated values with semicolons when I'd like them
> to be separated with "<br />"s.
>
> For instance, instead of "Value1; Value2; Value3", I'd like
> "Value1<br /> Value2<br /> Value3<br />".
>
> Thanks in advance for your help.
>
> Ellen


I don't have the function in front of me, but surely it can't be too hard to
change the '& ";" 'bit to '& "<br />"'

--
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"


 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      21st May 2010
On Fri, 21 May 2010 10:57:01 -0700, EllenM <(E-Mail Removed)>
wrote:

>Hello,
>I've found a wonderful concatenation function at
>http://www.mvps.org/access/modules/mdl0008.htm. It, however, separates the
>concatenated values with semicolons when I'd like them to be separated with
>"<br />"s.
>
>For instance, instead of "Value1; Value2; Value3", I'd like "Value1<br />
>Value2<br /> Value3<br />".
>
>Thanks in advance for your help.
>
>Ellen


Just fix the code to your needs: where it has

With lors
If .RecordCount <> 0 Then
'start concatenating records
Do While Not .EOF
lovConcat = lovConcat & lors(stFldToConcat) & "; "
.MoveNext
Loop
Else
GoTo Exit_fConcatFld
End If
End With

change it to

With lors
If .RecordCount <> 0 Then
'start concatenating records
Do While Not .EOF
lovConcat = lovConcat & lors(stFldToConcat) & " <br /> "
.MoveNext
Loop
Else
GoTo Exit_fConcatFld
End If
End With
--

John W. Vinson [MVP]
 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      21st May 2010
you would also need to fix the code in one other spot near the bottom of the
routine. If you want "<br /> " at the end of the string or not.

Either
fConcatFld = lovConcat
OR
fConcatFld = Left(lovConcat, Len(lovConcat) - Len("<br /> "))
instead of
fConcatFld = Left(lovConcat, Len(lovConcat) - 2)




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

John W. Vinson wrote:
> On Fri, 21 May 2010 10:57:01 -0700, EllenM <(E-Mail Removed)>
> wrote:
>
>> Hello,
>> I've found a wonderful concatenation function at
>> http://www.mvps.org/access/modules/mdl0008.htm. It, however, separates the
>> concatenated values with semicolons when I'd like them to be separated with
>> "<br />"s.
>>
>> For instance, instead of "Value1; Value2; Value3", I'd like "Value1<br />
>> Value2<br /> Value3<br />".
>>
>> Thanks in advance for your help.
>>
>> Ellen

>
> Just fix the code to your needs: where it has
>
> With lors
> If .RecordCount <> 0 Then
> 'start concatenating records
> Do While Not .EOF
> lovConcat = lovConcat & lors(stFldToConcat) & "; "
> .MoveNext
> Loop
> Else
> GoTo Exit_fConcatFld
> End If
> End With
>
> change it to
>
> With lors
> If .RecordCount <> 0 Then
> 'start concatenating records
> Do While Not .EOF
> lovConcat = lovConcat & lors(stFldToConcat) & " <br /> "
> .MoveNext
> Loop
> Else
> GoTo Exit_fConcatFld
> End If
> End With

 
Reply With Quote
 
EllenM
Guest
Posts: n/a
 
      21st May 2010
Thanks, John

And change:
fConcatFld = Left(lovConcat, Len(lovConcat) - 2)

to
fConcatFld = Left(lovConcat, Len(lovConcat) - 8)

Now it's a masterpiece.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Need Help With String Concatenation Rick Rothstein Microsoft Excel Worksheet Functions 6 15th Sep 2011 10:42 PM
Re: Need Help With String Concatenation Xt Microsoft Excel Worksheet Functions 1 15th Sep 2011 09:47 PM
Help writing a CONCATENATEIF function (filtered concatenation overrange) felciano Microsoft Excel Programming 6 19th Aug 2009 04:21 AM
need help to resolve concatenation error TJS Microsoft ASP .NET 2 16th Jan 2004 06:39 AM
Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! -$- Windows XP Internet Explorer 2 21st Dec 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


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