Table set up

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

How can I make sure that when data is entered in a table the data is all
caps. Example, I need state (two positions) to be all capital letters even if
the state is entered in initial caps.

I cannot figure it out....

Thanks,
 
On Tue, 10 Nov 2009 19:29:31 -0800, Mike

Alternatively you can set the Format property of a text box to ">", or
perhaps use the UCase(myField) function in query.

-Tom.
Microsoft Access MVP
 
I would use code in the after update event of the text box like:
If Not IsNull(Me.txtState) Then
Me.txtState = UCase(Me.txtState)
End If
 
You could try this in the KeyPress event of the Text box :-

KeyAscii = Asc(UCase(Chr(KeyAscii)))

HTH

Peter Hibbs.
 
Thanks, the > in the Format worked great...............thanks again

Just be aware that this Format merely *displays* the text in upper case - if
the user types "az" then the field will contain "az", and that's what you'll
see if you use it in queries, forms, etc. The Table Datasheet will show "AZ"
because of the format, but it doesn't make any permanent change to the data.
 
Back
Top