how do I force access to capitilize the text in a field

K

Ken Sheridan

Put the following procedure in any standard module in your database:

Public Sub ConvertToCaps(KeyAscii As Integer)
' Converts text typed into control to upper case

Dim strCharacter As String

' Convert ANSI value to character string.
strCharacter = Chr(KeyAscii)
' Convert character to upper case, then to ANSI value.
KeyAscii = Asc(UCase(strCharacter))

End Sub

and in the KeyPress event procedure of any control call it with:

ConvertToCaps KeyAscii
 
Top