Any idea how to change system keyboard lenguage with vba (1 Viewer)

MBMSOFT

Registered User.
Local time
Today, 01:47
Joined
Jan 29, 2010
Messages
90
Any idea how to change system keyboard lenguage with vba

I tried changing keyboard property in the control property and it works
but i need change in one control only, and if i change property it change for all contols after
so i need code on exit control event to change the system keyboard language
\e.g.
****************************************************
Private Sub A_Enter()
Me.A.KeyboardLanguage = 49
End Sub
Private Sub A_Exit(Cancel As Integer)
Me.A.KeyboardLanguage = 11
'this works(it means that keyboard language for ctl is changed back on english - 11, but system keyboard language remain on 49)
' so i need here to change system keyboard language

End Sub
*************************************************
 

MBMSOFT

Registered User.
Local time
Today, 01:47
Joined
Jan 29, 2010
Messages
90
I found the way how to manage this issue , so if it is halpfull for someone here it is:

Quote:
Code:
Private Declare Function ActivateKeyboardLayout Lib _
"user32.dll" (ByVal myLanguage As Long, Flag As Boolean) As Long

'define your desired keyboardlanguage
'find your desired language at [URL="http://www.trigeminal.com/frmrpt2dap.asp"][COLOR=#000088]http://www.trigeminal.com/frmrpt2dap.asp[/COLOR][/URL]

Private Const MKD = 1071 'macedonian keyboard language layout
Private Const eng = 1033 'english(united states)keyboard language layout


Private Sub A_Enter()

Call ActivateKeyboardLayout(MKD, 0)

End Sub

Private Sub A_Exit(Cancel As Integer)

Call ActivateKeyboardLayout(eng, 0)

End Sub
 
Last edited:

MyTech

Access VBA
Local time
Yesterday, 20:47
Joined
Jun 10, 2010
Messages
108
Yep, it just came to use for me, thanks.
 

semoho

New member
Local time
Today, 05:17
Joined
Jun 11, 2007
Messages
3
Hello
Which statement should I modify to work in windows 64bit with ms access 64bit?
 

Frothingslosh

Premier Pale Stale Ale
Local time
Yesterday, 20:47
Joined
Oct 17, 2012
Messages
3,276
This should do the trick:

Code:
Private Declare [COLOR=red]PtrSafe[/COLOR] Function ActivateKeyboardLayout Lib _
"user32.dll" (ByVal myLanguage As [COLOR=red]LongLong[/COLOR], Flag As Boolean) As [COLOR=red]LongLong[/COLOR]
 

Users who are viewing this thread

Top Bottom