Manngo
Oct 19 2005, 08:20 AM
Hello
I have a form, with a textbox. I want my VB code to write messages (log) to this textbox. Unfortuntelly I cannot manage with inserting linebreaks.
The control is a Textbox and the EnterKeyBehavior is 'New Line in Field'.
I tried this:
Forms!uploaddata!Log.SetFocus
Forms!uploaddata!Log.Text = Forms!uploaddata!Log & "Loading file..." & Chr(10)
and also tried with Chr(13), but neither worked. All the text appears in the Textbox, except the line breaks.
I'm using Access 2000.
Many thanks in advance
Manngo
xteam
Oct 19 2005, 08:32 AM
Try
String1 & vbCrLf & String2
Aazzner
Oct 19 2005, 08:37 AM
I have found that you need to use both in order to make it work.
"string" & Chr(10) & Chr(13) & "string"
That is the only way it would work for me.
I am assuming the vbCrLf is the vb character representation of the same thing
Cr = chr(10)
Lf = chr(13)
Hope it helps.
xteam
Oct 19 2005, 08:44 AM
I think vbCr > CarriageReturn is Chr(13) and vbLf > LineFeed is Chr(10)
Manngo
Oct 19 2005, 10:30 AM
This one worked:
String1 & vbCrLf & String2
Thanks a lot!
xteam
Oct 19 2005, 11:16 AM
You're welcome!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.