Processing "Enter", adding a new line

moorsey

Registered User.
Local time
Today, 01:05
Joined
Dec 28, 2005
Messages
49
Code:
If qdf.RecordsAffected > 0 Then
    Forms!switchboard!txtResult.Value = (Forms!switchboard!txtResult.OldValue & Chr(10) & "Invoice " & rst!InvoiceNo & " was updated")
Else
    Forms!switchboard!txtResult.Value = (Forms!switchboard!txtResult.OldValue & Chr(10) & "Invoice " & rst!InvoiceNo & " was not updated")
End If

I have this code after a few sql statements, it writes the result of the sql update, delete or add to a text box on a form

I am trying to put a new line in between each result using "Chr(10)", but this just inserts a square which I know is a newlines literal representation, but why is this not being put as a new line?

I have been through all of the properties in the text box, but nothing stood out to me.

I did try changing one property, I set the EnterKeyBehavior to "true" but this made no difference

I also tried "Chr$(10)" instead
 
You need both carriage return and line feed, and in that order. This means for instance chr$(13) & chr$(10), vbCr & vbLf, vbCrLf or vbNewLine
 
fantastic, thanks very much for you quick responce, works fine
 

Users who are viewing this thread

Back
Top Bottom