how can i setup access so data can only be entered in capitals?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i want my access database set up so that when people are entering data into
it the text automatically comes in only capitals, then in another field i
want it to automatically type only in lower case.

is this possible

thanks
 
i want my access database set up so that when people are entering data into
it the text automatically comes in only capitals, then in another field i
want it to automatically type only in lower case.

is this possible

thanks

Let them enter the data however they will.
For all upper case, code the AfterUpdate event of one control:
Me![ControlName] = UCase(Me![ControlName])

Code the AfterUpdate event of the other control:
Me![ControlName] = LCase(Me![ControlName])
 
Put the following procedure in any standard module in your database:

'Force input to UPPER case only

Public Sub UPPERCase(KeyAscii As Integer)

IF KeyAscii >= 97 And KeyAscii <=122 THEN _
KeyAscii = KeyAscii - 32

End Sub

'Force input to lower case only

Public Sub lowerCase(KeyAscii As Integer)

IF KeyAscii >= 65 And KeyAscii <=90 THEN _
KeyAscii = KeyAscii + 32

End Sub

you can then call either from the On Key Press event for the text box.

Hope this helps.
 
Another way is in the afterupdate event of the field place the
following:

me.fieldname = Ucase(me.fieldname)

This will make all letters uppercase but still allow other characters
as does the other code but might be slightly faster since it is only
called once.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top