var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: SQL - Force a new line
I have the following code in a VB script within an Access form. I’m updating the contents of a memo field with a combination of data contained in two other fields. After the update I can separate the two pieces of data with a space, & ‘ ‘ &, but I don’t know the correct code to force a line between them. Please advise. Thanks.
strSQL = "UPDATE tblone, tbltwo SET tblone.MemoField = [tbltwo].[MemoField] & ' ' & [tbltwo].[Darren], " _
windows uses a line feed and a carriage return for new lines.
so use \n \r in your string to define a new-line in windows. see
strSQL = "UPDATE tblone, tbltwo SET tblone.MemoField = [tbltwo].[MemoField] & \n & [tbltwo].[Darren], " _
nope. that don't work....
actually that was for php (here you have to use both : "\n \r")
but in vbscript and all vb apps these are the characters 10 und 13 in ascii
so it will be:
"my string in the first line" & chr(10) & chr(13) & "my string in the second line"
The result in the updated field is:
Text1 • • Text2
but if i copy and paste this data from the Access table to a word doc it displays correctly:
try only chr(10) or chr(13)
"text" & chr(10) & " newline text"
same result, the space displays as a small square. I’ve searched and it appears to be the way access handles ASCII code, I haven’t been able to find a solution yet, thanks for your help..
Access can't print a newline character in the table display. Try it with a form pulling data from the table. It will display.
I gave that a whirl, the memofield in the form displayed the data the same, the two bits of data separated by two small squares.
What Access are you using?
I figured out your problem! Chr(10) is \n and Chr(13) is \r, so the order should be Chr(13) & Chr(10), not the other way around. Windows uses \r\n not \n\r!
doh and more doh! Thanks. I couldn’t see the woods for the trees. Cheers.
best answer ever
Has to be one of most helpful, concise responses I've read so far on all these boards. Helped me, too.
Originally Posted by