Concate Codes in VBA (1 Viewer)

adrienne_r30

Registered User.
Local time
Today, 16:42
Joined
Jan 20, 2015
Messages
48
Hey All,
Quick question I hope someone can lead me to a good answer.

I am using code to concat some fields in VBA. I have no problem doing that, it works perfectly. But I am not knowledgeable of all the inner codes to make the output appearance change. I know that's confusing, sorry, let me explain.

I know that the code, 'vbCrLf', inserts an 'enter' in the appearance.
What are other codes that I can use. I am trying to find ways to make the appearance of what I am doing look better. Is there a master list somewhere that someone can lead me to?

If this is too confusing, I am sorry, I will try to explain more if necessary.

Thanks all!!
 

plog

Banishment Pending
Local time
Today, 15:42
Joined
May 11, 2011
Messages
11,638
I wouldn't use vbCrLf, it's kind of a hack. When you need to insert ASCII characters into your strings I would use the Chr() function: http://www.techonthenet.com/excel/formulas/chr.php

vbCRLF is a hack, in that it resolves to this:

Chr(10) & Chr(13)

Which means a new line and a carrriage return. For all the Chr() codes check this link out:


http://www.techonthenet.com/ascii/chart.php

Learning ASCII over VBA-specific string functions will be more beneficial to you if you ever move to a language other than VBA.
 
Last edited:

adrienne_r30

Registered User.
Local time
Today, 16:42
Joined
Jan 20, 2015
Messages
48
Awesome, thanks so much!
 

jdraw

Super Moderator
Staff member
Local time
Today, 16:42
Joined
Jan 23, 2006
Messages
15,379
@adrienne r30

What exactly are you formatting? Using forms or reports and laying out fields/controls affects appearance. You do not necessarily have to format via vba. It really depends on your requirements.
As plog said there are a number of intrinsic access/vba values that really represent underlying ascii codes or combinations.
 

Users who are viewing this thread

Top Bottom