Auto close a message box

User avatar
sistemaPR
2StarLounger
Posts: 119
Joined: 01 Jul 2013, 14:08

Auto close a message box

Post by sistemaPR »

Hi

Does anyone knows ? 1. Can I make a macro . to do a msgbox and on the same macro do sendkeys "enter" and close the msgbox.

what I want is to do a msgbox and close it automatically with user intervention, or to close it after few seconds

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Auto close a message box

Post by HansV »

No, that won't work. Code execution pauses as long as the message box is open.
As an alternative, you could create a form in Access that looks like a message box.
Set the Timer Interval property of the form to the number of seconds that you want the form to remain open. For example, if it should be displayed for 5 seconds, set Timer Interval to 5000.
Create a macro or event procedure for the On Timer event of the form, and close the form in this macro/event procedure.
Best wishes,
Hans