Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to SendKeys    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Better way for a msgbox
Thomas Gonder 
      
3 years ago
I've got a form that may display a message box.
My forms use timers. If the user doesn't click OK in the message box after a while, then I want to sendkeys an {enter] to kick it in the pants (closing the modal message box) so the code can continue.

Is there a better way (not Mr. Yuk) to do this?
Adam Schwanz  @Reply  
           
3 years ago
You could make your own message box as a form. Then you could customize about anything with it or use a timer event on that to close it and continue your code.
Kevin Yip  @Reply  
     
3 years ago
If your user Alt-Tabs away from Access (which they are likely to do when idle), then SendKeys will send keystrokes to the application being Alt-Tabbed to instead.  So I'm not a fan of this method.  A better method is Adam's suggestion: create your own form for the message box that you can close with VBA (DoCmd.Close ...) instead of having to close with a keystroke.
Thomas Gonder OP  @Reply  
      
3 years ago
While the two suggestions were coming in, I did a test with the message box and a timer. The timer never got to run, so the modal message box stops all VBA code until OK is pressed. So, the timer trying to use sendkeys would never run. So yes, I've got a status box on the form, and with some work, in there goes the message. Thanks guys.

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

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: 4/30/2026 2:40:04 PM. PLT: 0s