Full Version: Automatic Upper Case for Field values
UtterAccess Forums > Microsoft® Access > Access Forms
Dave1967
Hi all,
could anybody help me with a small drama, would like all text thats entered to be outomatically entered as Upper case without having to activate it on your keyboard, having been looking for that long im sure the answers staring me in the face.

Regards Dave
gavinclarke
Hi,

There are a few ways of doing this, probably the easiest is in the AfterUpdate event of each of your textboxes put
Me.txtBoxName = UCase(Me.txtBoxName)

FOr you could use input masks (you can get info on this in Access help)
> forces uppercase
problem with this is you have to specify how many characters can be entered so this may not be the one for you!

HTH
fkegley
I have done it like this:
hree text boxes, only one of which is bound to the table, the other two are for entry of first and last name. In the Change event of the txtFirstName text box:
Me.txtName = UCase(txtFirstName.Text) & " " & UCase(txtLastName.Value)
In the Change event of the txtLastName text box:
Me.txtName = UCase(txtFirstName.Value) & " " & UCase(txtLastName.Text)
fkegley
You could use some code in the KeyPress event of the text box, like this:
If KeyAscii >= 65 And KeyAscii <=90 Then
Else
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End If
Dave1967
Hi Frank,
thanks for that, have descided not to worry about it the invoices actually look better in lower case.
hought about playing around with the first letter defaulting to upper case in certain feilds, is this possible.
Cheers Dave
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.