Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CHR(13)

Status
Not open for further replies.

DougAtAvalon

Programmer
Jan 29, 2001
99
US
How do I bring in the carrage returns for a string function

If I have a string:

"fffff
GGG"

And I set that to a variable, then use SQL to put it in a field.

So I world use "ffff" & chr (13) & "ggg"

How do I find the carriage returns in the string variable???

-Doug
 
try
"ffff" & vbCrLf & "ggg"


PaulF
 
Line breaks are most often represented as a carriage return/line feed combination (Chr(13) & Chr(10)). The 'vbCrLf' constant is a 2-character string with a carriage return and line feed in it.

Some programs will consider a CR alone as a line break. Most will not consider a LF as a line break, unless it's preceeded by a CR. But all programs consistently recognize CR + LF as a line break, so I'd recommend you use that in your strings.

To locate a line break in a string, use the InStr function. The syntax is InStr([start,] stringToSearch, stringToFind). You should use vbCrLf as the 'stringToFind'. Rick Sprague
 
Doug / Paul / Rick :
This is crossposted see thread705-64466 Thanks,
Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top