Concatenate text and Linebreak in VBA

Timtropolis

Registered User.
Local time
Today, 15:55
Joined
Jun 17, 2004
Messages
84
G'day folks,

I have a piece of code that I use for one of my Msgboxes that uses the "chr(13)" for line breaks. It works fine. When I try this same approach for text in a memo field on a form, it doesn't.

Does anyone know if this is possible? I've included my code below to give you an idea.
Code:
Me.Historical_status = Me.Historical_status & Chr(13) & "--------------------" & Chr(13) & Me.Current_status
btw, the reason why I'm doing this is for asthetic purposes. There are two fields, one is current status, the other historical. I need copy the current into historical and use a series of dashes to separate.

TIA,
Tim
 
Tim,

Change the Chr(13) to vbCrLf.

The Chr(13) is only a Carriage Return.

Chr(13) & Chr(10) is a Carriage Return and a Line-Feed (should be OK).

vbCrLf is a CR-LF together. Works in VBA, but in a Query you'd have to
use the Chr(13) & Chr(10).

hth,
Wayne
 

Users who are viewing this thread

Back
Top Bottom