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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert LINEFEED in MEMO

Status
Not open for further replies.

RLyra

Programmer
Dec 6, 2002
21
0
0
BR
Hi from Brazil.

I want to insert a text into a memo field, with a query, but in a new line. How can I do it ???


Lyra
 
In a query vbCrLf doesn't work. You have to use the Chr() function. So your string would look like this.

strVal = Chr(10) & "Your string here"

Then you would need to use the SelStart to insert it at the end of the existing memo field.

Paul
 
It is not working.

First I put some text, after I have a second query where I wrote "trim([estrutura]) & Chr(10)" on this field (estrutura). After that, I add some text again.

After all that, it is not working. At the end, I get text plus a sign, plus more text. The sign is that box they use when they have a strange caracter.

Any ideia ??
 
Try "Chr(13) & Chr(10)" instead of just "Chr(10)".
Chr(13) is a carriage return, Chr(10) is newline.
 
Still not working. Still have a "box" on the place of line feed!!!

The query is this:

UPDATE [Temp 03] INNER JOIN (Texto INNER JOIN Norma ON Texto.CodProdasen = Norma.codProdasen) ON [Temp 03].valor = Texto.TipReg SET Norma.Estrutura = [estrutura] & Chr(13) & Chr(10);

And after this:

UPDATE (Texto INNER JOIN Norma ON Texto.CodProdasen = Norma.codProdasen) INNER JOIN [Temp 03] ON Texto.TipReg = [Temp 03].valor SET Norma.Estrutura = Trim([estrutura]) & " " & Trim([texto]);

I am cheking it at a form.

Something very strabge is happening here ...
I tryed to copy the text, from the form to this webform, with Ctrl-C and Ctrl-p. When I do it, the linefeed works. If I copy back, from webform to access form, it is Ok. But I cannot do it with more than 25000 records.

What hell is that ????

 
Could be you need to reverse the order to
Code:
Chr(10) & Chr(13)
? Sounds like they are both getting in there, but Access is not so forgiving about which comes first, and I haven't a clue which is it supposed to be, so it is worth a try. Alternately, try this function in place of the Chr functions:
Code:
Public Function strGetCrLF() as String
strGetCrLF = vbCrLf
End Function
Peleg
PelegNOSPAM@PStrauss.net
 
I don't know why copying from form to here and then back
would fix the problem, but I think you have embedded
linefeeds in your memo field that need to be changed to
CR + LF. You might take a look at thread705-431420,
where someone else was having a similar problem. It
contains a function from the Microsoft Knowledge Base you
can use to convert the LF's in your memo field to CRLF.
I tried this myself and it worked fine.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top