Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / February 2007

Tip: Looking for answers? Try searching our database.

All Caps

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Linda RQ - 09 Feb 2007 00:42 GMT
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
Rick Brandt - 09 Feb 2007 01:06 GMT
> 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.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Linda RQ - 09 Feb 2007 01:44 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?

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
Mikal - 09 Feb 2007 22:59 GMT
>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

Signature

Mike Pippins

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.