add txt to a new line in a label

smithsf22

Member
Joined
Jul 15, 2004
Messages
8
Programming Experience
Beginner
Hello, I am trying to display log information to the user from the database. It works fine my only problem is that I cannot find a way to control how it looks. I have the log data output to one sting that I put together in a loop. I am only using one label to display it all (about 8 – 15 entries). Is there a way to put a new line into a label filed so I can append the data to a new line? If that makes any sense.
Thanks
 
Append the vbNewLine string constant.
 
or you could use character code

label.text = "string literal" & chr(13) & strStringVariable

chr(13) = new line
 
chr(13) is not new line, it carriage return, chr(10) is line feed, together they currently make up the vbNewLine constant that is the same as vbCrLf constant. Those ascii codes work sometimes by their own, and you sometimes get strange behaviour from using only either one or maybe not getting the same out as you put in.
 
Back
Top