How to close Msgboxes and Inputboxes via code

Is it possible to close Msgboxes and Inputboxes vai code?
LVL 1
MilewskpAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
I don't think so. They are modal and require user interaction to close.  All code execution stops until manually closed.

Why would you need to do this?

mx
0
 
MilewskpAuthor Commented:
Hi mx,
I would like to expel stale users via code, but code won't run while a Msgbox or Inputbox is open.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
MilewskpAuthor Commented:
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.

0
 
MilewskpAuthor Commented:
The only solution I can think of is to use custom forms instead of the built-in Msgbox and InputBox. Know of any?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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

0
 
MilewskpAuthor Commented:
Thanks mx.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
You are welcome.

mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.