Adding spaces to text

A

Anna

I have requirements as to how long a field can be, so I
need to add filler characters.

ie--if I have text that ranges from "AAA" to "AAAAA" (3
characters to 5) and I want it to be followed by either 1,
2 or 3 spaces to make up my total of 6 in the field.

I've added leading zeroes to a data field that is numbers,
but can I use the same formatting technique for text
(Format ([field], "000000")?
 
K

Kent Prokopy

This will give you trailing spaces up to 6 long.

"AAA" & Space(6-Len("AAA"))

Where "AAA" is the name of you field...
 

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

Similar Threads


Top