Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capitalization

Status
Not open for further replies.

asmall

Programmer
Dec 26, 2002
31
US
Is there any way to force caps in the textboxes. I know you can go to the properties and use the ">" sign. But is there a way in code to force text to be capitalized while entering data?
 
use the > for the input mask then use
sub text_OnChangement
Me!text = UCase(Me!text)
end sub
 
I tried the code but I'm not able to type anything!
Am I doing it right?

This is what I have:

Private Sub txtFirstName_Change()

Me!txtFirstName = UCase(Me!txtFirstName)

End Sub
 
the mask should be

>aaaaaaaa 'the number of a's is the number of letters you want them to enter
 
I always place that in the AfterUpdate Event not the change event

PaulF
 
On the field.. goto property
then "on key press"

put this code in...

KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
If Chr(KeyAscii) = "" Then
KeyAscii = 0
End If

hope this helps
 
Thanks Dre313. That works perfectly!!!!
 
You can use this code on the afterupdate event:

(example text box is called Text87)

Me.Text87.Value = StrConv([Text87], vbProperCase)

There is also vbUpperCase, vbLowerCase and a few others...

Garry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top