How to combine the LEFT and VbCrLF thingy with a single text fiiled ...

E

Evertjan.

Techy wrote on 23 nov 2003 in microsoft.public.inetserver.asp.general:
I have used thecode which is below to get x characters on to display
<%= LEFT(rsName.Fields.Item("columnname").Value,50)%>

It works fine but when I use this same code to get x characters plus
display it using VBCRLF, with the <br> with writing the code :

<%=Replace LEFT
(Recordset1.Fields.Item("Detail").Value,VbCrLf,"<br><br>",50)%>

it gives me error so please can you tell me how can i trim the
characaters and at the same time use VBCRLF.

why does this above code with LEFT + vbCrLF doesn't work please help

You misplace your ()

<%
x = Left(rsName.Fields.Item("columnname").Value,50)
y = Replace(x,VbCrLf,"<br><br>")
response.write y
%>

or:

<%=Replace(Left(rsName.Fields.Item("columnname").Value,50),VbCrLf,"<br>
<br>")%>
 
H

Harag

change
<%= LEFT(rsName.Fields.Item("columnname").Value,50)%>

to

<%= Replace(Left(rsName.Fields.Item("columnname").Value, 50), vbCrLf,
"<br><br>") %>

HTH.
Al
 
T

Techy

I have used thecode which is below to get x characters on to display
<%= LEFT(rsName.Fields.Item("columnname").Value,50)%>

It works fine but when I use this same code to get x characters plus display
it using VBCRLF, with the <br> with writing the code :

<%=Replace LEFT
(Recordset1.Fields.Item("Detail").Value,VbCrLf,"<br><br>",50)%>

it gives me error so please can you tell me how can i trim the characaters
and at the same time use VBCRLF.

why does this above code with LEFT + vbCrLF doesn't work please help

thanks
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top