Access report richtext new line
A specific question!
In Access, when you want to insert a new line in a Richtext control, you can use the following methods:
- Using the
vbCrLf
constant: You can use thevbCrLf
constant, which represents a carriage return and a line feed, to insert a new line in the Richtext control. For example:Me.YourRichtextControl.Text = Me.YourRichtextControl.Text & vbCrLf & "New line of text"
- Using the
Chr(13) & Chr(10)
method: Another way to insert a new line is to use theChr(13)
andChr(10)
functions, which represent a carriage return and a line feed, respectively. For example:Me.YourRichtextControl.Text = Me.YourRichtextControl.Text & Chr(13) & Chr(10) & "New line of text"
- Using the
vbNewLine
constant: In Access 2007 and later versions, you can use thevbNewLine
constant, which represents a platform-independent new line character. For example:Me.YourRichtextControl.Text = Me.YourRichtextControl.Text & vbNewLine & "New line of text"
Note that the
vbCrLf
andChr(13) & Chr(10)
methods are specific to Windows, while thevbNewLine
constant is platform-independent.