[AccessD] More on vbCr, vbLf, VbNewLine, and vbCrLf

Gustav Brock Gustav at cactus.dk
Wed Dec 13 03:30:27 CST 2006


Hi Susan

That's what is dangerous. One day you may need it elsewhere and you may be hosed.

To conclude: Using vbNewLine is the safe way as it is easy to remember and performs correctly in any Windows environment.
However, in SQL it is not recognized and you have to fall back to Chr(13) & Chr(10) for a new line. If that bothers you (not you, the SQL programmer) because it messes up the SQL, create a tiny function which is easy to remember and understand:

Public Function NewLine() As String
  NewLine = vbNewLine
End Function

and use that in your SQL.

/gustav

>>> ssharkins at setel.com 13-12-2006 00:00 >>>
I'm just dealing with message text in a message box. :) 

Susan H. 


Hi Susan

I meant that no matter what you type, Access will try to display it
correctly.

However, if you construct a string with the various constants and assign
this to a, say, textbox, you'll for the wrong constants meet the funny small
boxes instead of new lines. Try it.





More information about the AccessD mailing list