Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to close Msgboxes and Inputboxes via code

Posted on 2011-09-30
8
Medium Priority
?
244 Views
Last Modified: 2013-11-28
Is it possible to close Msgboxes and Inputboxes vai code?
0
Comment
Question by:Milewskp
  • 4
  • 4
8 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 36893069
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
 
LVL 1

Author Comment

by:Milewskp
ID: 36893075
Hi mx,
I would like to expel stale users via code, but code won't run while a Msgbox or Inputbox is open.
0
 
LVL 75
ID: 36893149
"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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 1

Author Comment

by:Milewskp
ID: 36893192
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
 
LVL 1

Author Comment

by:Milewskp
ID: 36893197
The only solution I can think of is to use custom forms instead of the built-in Msgbox and InputBox. Know of any?
0
 
LVL 75
ID: 36893212
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
 
LVL 1

Author Closing Comment

by:Milewskp
ID: 36911752
Thanks mx.
0
 
LVL 75
ID: 36911766
You are welcome.

mx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question