Capitalise all letters

  • Thread starter Thread starter Jim Mills
  • Start date Start date
J

Jim Mills

Hi

I hope this is the right forum...
Has anyone got some code which will capitalise all letters entered via a
form?

Much appreciated. Jim
 
Hi Jim,

you could put this into the KeyPress event of your textbox:

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then ' If key is 'a' to 'z'
KeyAscii = KeyAscii - 32 'Change to 'A' to 'Z'
End If
End Sub

Cheers,

ChrisM
 
Jim,

In the control's AfterUpdate event, add teh following code:
Me.txtMyTextBox = UCase(Me.txtMyTextBox)

....but having told you that, why would you want to actually store the data
in uppercase? The Jet database ins case-insensitive, so you can't do
anything useful with it in uppercase. If all you really want is to "view" it
in uppercase, then set each control's Format property to >

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Back
Top