new line inside a text box

P

Paolo

Using Acess200 or Access2003
I need to combine programmatically several fieds forming an adress and display them on several lines inside a tex box.
I do not succeed finding the character code that will bring me the new line
'--------------------
Private Sub cmdCombine_Click()
Dim strAddress As String
Dim strNL As String 'new Line

strNL = Chr(10) 'I tried several charcters , no one works

strAddress = ""
strAddress = strAddress & "Company :" & Me.txtCompany & strNL
strAddress = strAddress & "Title :" & Me.txtTitle

Me.txtAddress = strAddress

End Sub
 
K

Kevin Sprinkel

Visual Basic has many built-in constants that you can
refer to by name for purposes similar to this one. Try:

vbCRLF

HTH
Kevin Sprinkel
-----Original Message-----
Using Acess200 or Access2003
I need to combine programmatically several fieds forming
an adress and display them on several lines inside a tex
box.
 
F

fredg

Using Acess200 or Access2003
I need to combine programmatically several fieds forming an adress and display them on several lines inside a tex box.
I do not succeed finding the character code that will bring me the new line
'--------------------
Private Sub cmdCombine_Click()
Dim strAddress As String
Dim strNL As String 'new Line

strNL = Chr(10) 'I tried several charcters , no one works

strAddress = ""
strAddress = strAddress & "Company :" & Me.txtCompany & strNL
strAddress = strAddress & "Title :" & Me.txtTitle

Me.txtAddress = strAddress

End Sub

Regarding:> strNL = Chr(10) 'I tried several charcters , no one works<

You need to use
chr(13) & chr(10)
IN THAT ORDER.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top