In a new standard module place this code:
'**************** Code Start ************************
'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
'************** Code End ****************
When prompted name the module ControlCapsLock
In the On_Load sub of the first form in your db that is used place this code:
'********** Code Start ****************
'Turn Capslock On
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPLOCK) = 1
SetKeyboardState kbArray
'********** Code End *****************
In the last form before closing your db, place this code in the Form_Unload
event:
'************ Code Start *****************
'Turn Capslock OFF
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPLOCK) = 0
SetKeyboardState kbArray
'*********** Code End ********************
Good Luck!
--
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200705/1