How to Right Justify a string variable.

T

ThomasAJ

I need to Right Justify and blank fill a string variable. Any easy way to do
this other than a character at a time?
 
J

John W. Vinson

I need to Right Justify and blank fill a string variable. Any easy way to do
this other than a character at a time?

Where are you doing this? In data entry on a form, in an update query, or
what?

You can use an expression like

Right(String(25, " ") & strMyString, 25)

to left-pad the string in strMyString to 25 characters with leading blanks.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top