Force Uppercase

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

Guest

Is there a way to force answers to be uppercase without using an input mask

Thanks As Always
Rip
 
Is there a way to force answers to be uppercase without using an input mask?

Thanks As Always,
Rip

Let the user enter the data as they wish.
Code the Control's AfterUpdate event:

[ControlName] = UCase([ControlName])
 
If you only want to SEE them in upper case, you can put a > in the Format
property of the field. If you actually want them converted to upper case,
you can use the UCase function in the AfterUpdate event of a textbox on a
form. (You can't do it directly in a table)

Me.txtMyText = UCase(Me.txtMyText)
 
While an input mask seems the easiest way to do it, you
can call UCase, either in the On KeyDown event to convert
each character as it is entered or all at once in the
AfterUpdate event.

Private Sub txtYourControl_KeyDown(KeyCode As Integer, _
Shift As Integer)

txtYourControl = UCase (txtYourControl)

End Sub

HTH
Kevin Sprinkel
 
Private Sub txtYourControl_KeyDown(KeyCode As Integer, _
Shift As Integer)

txtYourControl = UCase (txtYourControl)

End Sub

That won't work. You'll never be able to enter more than one character due to
the fact that your entire entry will be highlighted each time you press the key
after the first character. You might be thinking of the following in the
control's "KeyPress" event procedure:

KeyAscii = Asc(UCase(Chr(KeyAscii)))
 
That won't work. You'll never be able to enter more than
one character due to
the fact that your entire entry will be highlighted each time you press the key
after the first character. You might be thinking of the following in the
control's "KeyPress" event procedure:

KeyAscii = Asc(UCase(Chr(KeyAscii)))

Thank you, Bruce, and apologies Ripper.
 
Back
Top