> 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

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
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
>> 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
[quoted text clipped - 5 lines]
> Use a format property of ">". Won't work on a memo field without
> truncating it though.
missinglinq - 09 Feb 2007 03:18 GMT
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

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000
Linda RQ - 09 Feb 2007 06:01 GMT
Wow, thanks...Linda
> Since your users want all fields in the db to be all caps, the easiest way
> by
[quoted text clipped - 56 lines]
>
> 'XXXXXXXXXX End of Code XXXXXXXXXXXXXXXXXXXXXXX
Rick Brandt - 09 Feb 2007 12:43 GMT
> 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.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Linda RQ - 11 Feb 2007 00:29 GMT
>> Hi Rick,
>>
[quoted text clipped - 8 lines]
> 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