All Caps

  • Thread starter Thread starter Linda RQ
  • Start date Start date
L

Linda RQ

My users want all the fields in the database to be all caps. Is there a way
to change all the forms and reports to show in all caps despite how it was
typed in?

Thanks,
Linda
 
Linda said:
My users want all the fields in the database to be all caps. Is
there a way to change all the forms and reports to show in all caps
despite how it was typed in?

Thanks,
Linda

Use a format property of ">". Won't work on a memo field without truncating it
though.
 
Hi Rick,

Ok...I put it in the format property on the field in the table...that didn't
work on the form. I put it in the format property on the control on the
form...that worked but it didn't carry over to my report. Anyway to get it
to just do it on everything at once?

Thanks,
Linda
 
Since your users want all fields in the db to be all caps, the easiest way by
far (which I've been using successfully for a number of years) is to turn on
CapsLock when you start up the application. It's really not hard at all! Just
Copy and paste the code in the appropriate places! Make sure you get the
apostrophes before the Beggining/Ending of Code comments!

From the Objects Dialog Box goto Modules and in a new module place this code:

''XXXXXXX Beginning of Code XXXXXXXXXXXXXXXX
'' 'Windows API/Global Declarations for :CapLock

Public Const VK_CAPLOCK = &H14

Public Type KeyboardBytes
kbByte(0 To 255) As Byte
End Type
Public kbArray As KeyboardBytes

Public Declare Function GetKeyState Lib "user32" _
(ByVal nVirtKey As Long) As Long
Public Declare Function GetKeyboardState Lib "user32" _
(kbArray As KeyboardBytes) As Long
Public Declare Function SetKeyboardState Lib "user32" _
(kbArray As KeyboardBytes) As Long

'XXXXXXXXXX End of Code XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When prompted name the module ControlCapsLock

In the On_Load sub of the first form in your db that is used place this code;
this turns CapsLock On:

''XXXXXXX Beginning of Code XXXXXXXXXXXXXXXXXXXXXX

'Turns Capslock On
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPLOCK) = 1
SetKeyboardState kbArray

'XXXXXXXXXX End of Code XXXXXXXXXXXXXXXXXXXXXXX

Then in the last form that's open before closing your application place this
code; this turns CapsLock Off. Probably in the form's Unload event would be
best.

''XXXXXXX Beginning of Code XXXXXXXXXXXXXXXXXXXXXX

'Turns CapsLock Off
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPLOCK) = 0
SetKeyboardState kbArray[/code]

'XXXXXXXXXX End of Code XXXXXXXXXXXXXXXXXXXXXXX

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
Linda said:
Hi Rick,

Ok...I put it in the format property on the field in the table...that
didn't work on the form. I put it in the format property on the
control on the form...that worked but it didn't carry over to my
report. Anyway to get it to just do it on everything at once?

Format properties do not "pass through" to other objects. However if you had put
that format on the table BEFORE you built your form or your report and had you
used the wizard to create them Access would have *copied* the format property
over for you. After-the-fact you have to apply the property everywhere you need
it.
 
Linda said:
My users want all the fields in the database to be all caps. Is there a way
to change all the forms and reports to show in all caps despite how it was
typed in?

Thanks,
Linda
In addition to Missingling's post below (which I intend to get a little
mileage out of, too, if you have a lot of data already in there, you can run
an update query on your existing tables something like this:

UPDATE myTable SET myTable.myField = UCase([myField]);

That'll capitalize everything thats already entered.

Do this *after* you have made a backup copy of your tables.

HTH

Mike

--
Mike Pippins

"We have met the enemy and he is us." -- Pogo Possum

Message posted via AccessMonster.com
 
Rick Brandt said:
Format properties do not "pass through" to other objects. However if you
had put that format on the table BEFORE you built your form or your report
and had you used the wizard to create them Access would have *copied* the
format property over for you. After-the-fact you have to apply the
property everywhere you need it.


Rats. You guys didn't tell me that when I got started <g>

Linda
 
Back
Top