Milewskp
asked on
How to close Msgboxes and Inputboxes via code
Is it possible to close Msgboxes and Inputboxes vai code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"but code won't run while a Msgbox or Inputbox is open."
Right. Exactly. Once open, further execution of code halts. You're basically stuck. Both are 'Access Modal' ... and in fact, can be made System Modal - a Message Box option.
It *might* ... be possible from another db if you could execute an Application.Quit that was in a Function in the target db ... but I don't think so. You pretty much would have to Kill the process.
I have a pretty amazing Forced Shutdown module that is part of my automated backup app ... but that is the one glitch I've not been able to get around. Fortunately, in 1.5 years, no user has left a db in a state wherein a MsgBox was open.
mx
mx
Right. Exactly. Once open, further execution of code halts. You're basically stuck. Both are 'Access Modal' ... and in fact, can be made System Modal - a Message Box option.
It *might* ... be possible from another db if you could execute an Application.Quit that was in a Function in the target db ... but I don't think so. You pretty much would have to Kill the process.
I have a pretty amazing Forced Shutdown module that is part of my automated backup app ... but that is the one glitch I've not been able to get around. Fortunately, in 1.5 years, no user has left a db in a state wherein a MsgBox was open.
mx
mx
ASKER
Hi mx,
<, in 1.5 years, no user has left a db in a state wherein a MsgBox was open>
Interesting, it happens all the time with my databases. Maybe because my error handler opens a msgbox(?) (I've recently changed this, so that the user is informed by status bar text instead).
I use a forced shutdown module too. I'll open a new question so we can compare notes.
<, in 1.5 years, no user has left a db in a state wherein a MsgBox was open>
Interesting, it happens all the time with my databases. Maybe because my error handler opens a msgbox(?) (I've recently changed this, so that the user is informed by status bar text instead).
I use a forced shutdown module too. I'll open a new question so we can compare notes.
ASKER
The only solution I can think of is to use custom forms instead of the built-in Msgbox and InputBox. Know of any?
Well ... You *could* ... create a custom msgbox ... with some sort of a timer option such that it would close after some duration with a default action. But ... I'm not big on reinventing that wheel.
I took Peter's FSD free app (http://www.peterssoftware.com/fsd.htm) ... and rolled it into a full blown app that works very well.
I don't recall a custom msgbox 'form' right off, but of course there may be some.
mx
I took Peter's FSD free app (http://www.peterssoftware.com/fsd.htm) ... and rolled it into a full blown app that works very well.
I don't recall a custom msgbox 'form' right off, but of course there may be some.
mx
ASKER
Thanks mx.
You are welcome.
mx
mx
ASKER
I would like to expel stale users via code, but code won't run while a Msgbox or Inputbox is open.