Change code page from Access97


Question

Does anybody know how to change the codepage at runtime in a form to enable the user to write text in different languages?

Answer

Robert,

The following code works for me under WinNT 4.0 with English (US), German (standard) and Russian keyboard layouts installed:

Declare Function ActivateKeyboardLayout& Lib "user32" _
                 (ByVal HKL As Long, ByVal flags As Long)

Sub a_test()
  ' English (United States)
  ActivateKeyboardLayout &H4090409, 0
  ' German (standard)
  ActivateKeyboardLayout &H4070407, 0
  ' Russian
  ActivateKeyboardLayout &H4190419, 0
End Sub

HTH,
Shamil


Copyright 1999-2008 by Shamil Salakhetdinov. All rights reserved.