Free Lessons
Fast Tips
Topic Index
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
Home > Forums > Access
Access Forum

Back to Access Forum

SendKeys Is Evil Upload Images   Link  
Nancy Troutman 
16 months ago
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
Richard Rost
16 months ago
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!
Richard Rost
16 months ago
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.
Richard Rost
16 months ago
Which key it is doesn't matter. Putting something together for you now. Stay tuned.
Richard Rost
16 months ago
Here you go: Turn Caps Lock On Off
Nancy Troutman
16 months ago
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.

Thanks so much for the solution!
Richard Rost
16 months ago
My pleasure

This thread is now closed. If you wish to comment, start a NEW discussion, below.

Back to Access Forum Comments

Start a NEW Conversation
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.

You may want to read these articles from the 599CD News:

5/27/2022Add Anything
5/26/2022List Items Edit Form
5/25/2022Column Colors
5/24/2022Multi-Table Forms
5/21/2022Access Developer 39
5/21/2022Access Developer 39 Lessons
5/21/2022Access Developer 39
5/21/2022Select Items in Related Table
5/21/2022Clear List Box

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn