UCASE

  • Thread starter Thread starter Richard Martin
  • Start date Start date
In VBA code, as a variable:

strNameInCaps = UCase([MyField])

In a query:

NameInCaps: UCase([MyField])

hth,
 
Richard,
I think you're saying how do I force entries in a field to be Upper Case,
even if the user enters the data in Lower Case?
On the AfterUpdate event of a field called (ex.) [MyField1]... and a user
entry of "aBcDeF"
[MyField1] = UCase([MyField1])
will store the entry in Upper case even if the user entered uppercase,
lowercase, or a mix of each ("ABCDEF")

Note: Just using the ">" Format for a field will DISPLAY any entry in
upper case, but does not save the data in the table as uppercase.
 
How do i use the UCase to make a field uppercase only?

In addition to the other solutions offered, you can also force the entries to
upper case as they are typed from within the control's "KeyPress" event
procedure:

'**********
Private Sub txtUpper_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
'**********
 
Back
Top