letter capitalisation

cl159037

Registered User.
Local time
Tomorrow, 04:17
Joined
Nov 22, 2011
Messages
13
m using office 2007: when i type the data in a access form, i want all the words that i type to be saved in a capitalized format irrespective of whether my caps lock is on or no.
 
I tried typing in with caps lock off it only displays the data in the field in the caps lock format but the data entered in the main database table is still small caps.
 
I thought you will be happy with it just being formatted. As long as you're happy with it being capital for life then you can do the following:

In the After Update event of the control, put:
Code:
Me![COLOR=Red]FieldName[/COLOR]= UCase(Me![COLOR=Red]FieldName[/COLOR])
 
i tried doing this, but the problem isn't solved.
 
Here's one method. In a Standard Module place this code:
Code:
'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
Now, in an appropriate event, such as a Form's Form_Load event, place this code:
Code:
'Turn Capslock On
 GetKeyboardState kbArray
 kbArray.kbByte(VK_CAPLOCK) = 1
 SetKeyboardState kbArray
At this point, Caplsock will be turned on until Access itself is closed or until you execute this code:
Code:
'Turn Capslock Off
 GetKeyboardState kbArray
 kbArray.kbByte(VK_CAPLOCK) = 0
 SetKeyboardState kbArray
in an appropriate event.

Brief testing indicates that this behavior is only within Access, i.e. if you're multi-tasking, say working in Access and in a Word document, having Caps ON in Access does not effect your typing in the Word document.

Most developers consider entering data in all Caps to be undesirable, but to each his or her own!

I also know that some mainframe/mini-frame systems require it when interfacing with apps like Access, and I believe that was the reason this particular hack was developed.

Linq ;0)>
 
Brief testing indicates that this behavior is only within Access, i.e. if you're multi-tasking, say working in Access and in a Word document, having Caps ON in Access does not effect your typing in the Word document.
As I was reading through the code this was the question that popped up in my head and when I read further you covered that. :)

I've not tested it but it looks promising.
 
I ran up an app about ten years ago that's still running, without problems, using this hack! The Luddite paying for the deal just HAD to have everything capitalized! Of course, when queried as to why, he just shrugged his shoulders!

Well, he was paying the freight! But when he called me about another major app, a couple years later, I declined, telling him life was too short! :p He started making a sort of gargling sound, not unlike my old Black Lab the time I gave him a plug of dill pickle! Felt sorrow for Puck, but not for the (ex)client!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom