Right alignment text field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
Back
Top