stevo
03-29-2010, 02:06 AM
Can anyone please help.
I am adding string fields together in a report text box. How can I get consistent spaces between them, is there maybe some sort of tab command. I have tried the following, but I still get uneven spaces depending on the length of the first field.
=[Pnum_1]+Space$(25-Len([Pnum_1]))+ [Pnum_2]
DCrake
03-29-2010, 02:58 AM
Problem is to do with propotional spacing and the font used. In order to get it as you want you will need to use a font such as Courier new (equal sized character widths)
stevo
03-29-2010, 03:14 AM
Thanks for your reply david, however I tried using courier and I still find that alignment dependson the length of the first field.
vbaInet
03-29-2010, 05:28 AM
Uneven spacing being number of spaces or visually? Check that the text box isn't Justified or set to Distribute. This is a Text Align property.
gemma-the-husky
03-29-2010, 05:48 AM
if you are using courier, then you also need to ensure that each field is set to occupy the same character count, by padding, or adding suitable spaces.
its tricky
you may even be able to achieve this by prefilling a string with spaces to a given length, and then manipulating this string
but string manipulation of this kind is still a little tricky, because with vba its not that easy to insert a substring into a particular location in a string.