Right alignment text field

G

G.Lauzon-AFLA

This must have ben asked a lot, but can't find how to do it.
I want a text field (lets say 10 char long) to be stored right align padded
with blanks on the left (or even some other character like _ if there is no
other way).
This is because I want "80A" to be smaller than "555C" and smaller than
"33333X".
I would like this to be done as the user enters the information, not with
some other process done afterwards.
Thanks all.
 
J

John Nurick

It's actually the first time I've seen it asked. Try something like this
in the field's BeforeUpdate event:

With Me.ActiveControl
.Text = Right(Space(10) & Trim(.Text), 10)
End With
 

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