What is wrong with my code? I need the scroll lock be pressed so that an Autohotkey script gives me quick access to Unicode characters.
Instead of turning on the Scroll Lock key, it toggles the Scroll Lock key. So "SendKeys "{scrolllock}", True" will toggle the Scroll Lock off it is already on.
Private Sub Search4Root_Click() SendKeys "{scrolllock}", True Call ActivateKeyboardLayout(Heb, True) Me.FilterOn = False DoCmd.GoToRecord , "", acFirst DoCmd.RunCommand acCmdFind SendKeys "{scrolllock}", False On Error Resume Next End Sub
It's funny that you mention SendKeys. I just spent about 10 minutes in Access Developer 24 telling everyone how SendKeys is evil and you should never use it. I used it, too, when I first started using Access back in 1994. No. It's evil. Don't use it.
Nancy Troutman 16 months ago
Arggghhhhh! I want the 3 days I spent trying to make it work back!
If you REALLY need that to work, I'm sure there's a way to check the state of the scroll lock key. I've written code before to toggle CAPS LOCK on and off. Gimme a bit...
Nancy Troutman 16 months ago
Actually, I can switch the key that triggers the Autohotkey script from Scroll Lock to CapLocks. The MS Hebrew keyboard does not give me vowels. I put all the vowels into the AutoHotkey script - using Unicode.
I just discovered another reason to split the database. I was putting Sendkey on every field to force the field into the correct language. I was able to abandon the front-end and restore a back-up I made just before I started the SendKey nonsense without losing all the data-entry I had done.