Caps Lock 'On'

Pallooma2

New member
Local time
Today, 04:16
Joined
Mar 13, 2004
Messages
6
Hi fellas, and Fellesses,

Is there anyway of forcing Caps Lock on when Access is lauched. I've used the 'Ucase' method both in After Update and in an update querie when forms are closed, but this seems a bit long winded.

Any help Mucho Thanko

Iz.
 
Code:
Option Compare Database
Option Explicit

'http://vbnet.mvps.org/index.html
'Activating CapsLock, NumLock, ScrollLock and PrintScreen on NT/2000
'For Windows NT4, Windows 2000, Windows XP

Private Declare Sub keybd_event Lib "user32" _
  (ByVal bVk As Byte, _
   ByVal bScan As Byte, _
   ByVal dwFlags As Long, _
   ByVal dwExtraInfo As Long)
    
Private Declare Function MapVirtualKey Lib "user32" _
   Alias "MapVirtualKeyA" _
  (ByVal wCode As Long, ByVal wMapType As Long) As Long
    
Private Const KEYEVENTF_KEYUP = &H2
Private Const KEYEVENTF_EXTENDEDKEY = &H1

[COLOR=Blue]Public Sub ToggleCapsLock()[/COLOR]
[COLOR=SeaGreen]'this sub will turn on the Caps Lock if it is off or turn the Caps Lock off if it is on[/COLOR]

    Call keybd_event(vbKeyCapital, MapVirtualKey(vbKeyCapital, 0), KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
    Call keybd_event(vbKeyCapital, MapVirtualKey(vbKeyCapital, 0), KEYEVENTF_EXTENDEDKEY Or 0, 0)

[COLOR=Blue]End Sub[/COLOR]
 

Users who are viewing this thread

Back
Top Bottom