Forcing text size

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

Guest

I have a billing field that has a user enter an alpha number invoice
identifier and i would like to ensure that any entry in this field will be
large caps regardless if the end user keys in small caps. How is this done?
 
In the Exit event of your textbox, put:
Me.Text0 = UCase(Text0) 'substituting the name of your textbox
 
In the AfterUpdate event of the textbox use:

Sub txtMyTextbox_AfterUpdate()
Me.txtMyTextbox = UCase(Me.txtMyTextbox)
End Sub

or

You can also use the KeyPress event to force the entry to upper case as it
is entered:

Sub txtMyTextbox_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
 
Back
Top