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
 

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

Back
Top