Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > AppActivate < Blocked! | Merge Tables >
Back to AppActivate    Comments List
Upload Images   @Reply   Bookmark    Link   Email  
Problem with Code
Sandra Truax 
          
3 years ago
Richard, I loved your comment about using Access to log onto your websites. I've come up with this code that works, but every time I use it, it turns my NumLock off.  Can someone tell me why, or maybe a better way?  

Private Sub LogOnBtn_Click()

    Dim X1 As Long, XX1 As Long, X2 As Long, XX2 As Long
    
    XX1 = Forms!AccountInfoF!Tab1
    XX2 = Forms!AccountInfoF!Tab2
    
    FollowHyperlink Website
    Sleep 1000
    
    If XX1 = 0 Then GoTo LO
    For X1 = 1 To XX1
        SendKeys "{TAB}", True
        Sleep 25
    Next
    
LO:
    SendKeys Login, True
    
    For X2 = 1 To XX2
        SendKeys "{TAB}", True
        Sleep 20
    Next
    
    SendKeys Password, True
End Sub
Kevin Yip  @Reply  
     
3 years ago
I believe it's a bug in the SendKeys command.  The workaround is to run the SendKeys command again (somewhere) to turn NumLock on again.

I've rarely used SendKeys because it is often unreliable.  All the "Sleep" times you use in your code above have to be guess work.  That's not something you want to rely on to do any critical task.

In the old days when text terminals were used, you could press keys (way) in advance and your inputs would be processed correctly (if the keys were pressed in the right order).  Nowadays, keystrokes, taps, and mouse clicks can only be done when the screen is ready for that particular input, not a nanosecond early or later.
Richard Rost  @Reply  
          
3 years ago
Yep... SendKeys will do that with NumLock. Happens to me too. There is a way you can toggle NumLock on and off using code. See the extended cut for Caps Lock On Off. Just send a command to FORCE NumLock on/off depending on what you want AFTER all of your SendKeys.

And yeah... I know... it's a pain... and I did mention in the video several times that SendKeys can be unreliable. But, if you're trying to do unorthodox stuff like logging into your bank's website, it's the best we can do with Access.

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

 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/17/2025 10:49:16 AM. PLT: 2s