Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Change Language Settings in VBA
Willem Els 
   
2 years ago
Hi Richard,

I hope you're doing well.

I am currently in the process of learning a second language, Polish, and have created a database to assist me. This database contains common words in English alongside their Polish translations in separate fields. My goal is to eventually use this data to create flashcards for study purposes. For now, I am manually entering the words as part of my learning process.

However, I’ve encountered a challenge. Every time I switch between fields, I need to manually change the keyboard settings to match the language of the field—US English for one and Polish for the other. To streamline this process, I would like to implement a solution in VBA for MS Access that automatically switches the keyboard language based on the field’s focus.

Could you assist me by providing the VBA code to toggle the keyboard language between US English and Polish when a field gains focus? Your guidance would be greatly appreciated.

Thank you in advance for your help!

Best regards,  
William
Sami Shamma  @Reply  
             
2 years ago
Hi William,
The solution will be to send the keys strokes from VBA to switch languages. This video will help:

  
SendKeys
Alex Hedley  @Reply  
           
2 years ago
Alex Hedley  @Reply  
           
2 years ago
DetailsPrivate Declare PtrSafe Function ActivateKeyboardLayout Lib _
"user32.dll" (ByVal myLanguage As Long, Flag As Boolean) As Long

'define your desired keyboardlanguage
'find your desired language at http://www.trigeminal.com/frmrpt2dap.asp

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
Richard Rost  @Reply  
          
2 years ago
Nice solution, Alex. I'll definitely add this to the Fast Tips list.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/8/2026 10:06:43 PM. PLT: 1s