ValidationRule for upper case

  • Thread starter Thread starter David DeRolph
  • Start date Start date
D

David DeRolph

Access 2003. How can data entry for a field be restricted to upper case, or
automatically convert lower case letters to upper case?
 
David

The disadvantage to having all uppercase stored is that it is very difficult
to correctly un-uppercase words like, say, last names?! If you can imagine
needing the up/low case word, then store the data entry the way it was
entered ... and use a query with something like:
UCase([YourField])
to (temporarily) produce all uppercase for display, report, mailing labels,
etc.

If you will only ever need uppercase, you can restrict using the input mask
(check Access HELP), or convert using the UCase() function in a BeforeUpdate
event for the field.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
David

If you always want upper case then you can place the code below in the
KeyPress event of the text box. This shows the characters in upper case as
the user enters them (which looks better than converting them afterwards, I
think).

Private Sub YourTextField_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
 
Back
Top