Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to put a TAB chr() in a string expression?

Status
Not open for further replies.

adrift

Programmer
Sep 12, 2001
46
CA
The chr(13) & chr(10) has been a life saver for carriage returns, is there a similar method for using a tab in a string expression. I'm concanating two strings but the first string has variable length, but I'd still like the second string to match up in alignment. IE:
 
Use the VB constant, vbTab, in order to include a tag in a concantenated string.

Example:

strData = 'The temperature is : " & vbTab & "65 degrees"
 
I've tried both that and chr(9) and it displays the dreaded little box character rather than the expected tab.
 
Why concatenate? If you want them to line up, why not just leave them in 2 fields and use 2 TextBoxes, then Right Justify the 1st TextBox, and Left Justify the 2nd TextBox.

PaulF
 
Because I'm concatenating in VBA based on a criteria search. It is necessary to do it this way.
 
try using spaces
In this example 20 would be the maximum length of Field1

Field1 & Space(20 - Len(Field1)) & Field2


PaulF
 
that's the ticket.. thanks..

by the way, now that you're here.. can you recommend any free rich text format controls?

I was using the microsoft one but it doesn't allow print preview..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top