The way this is typically done is to have a startup form (in tools|Startup) that never closes. You canuse this as your switchboard form. When the user moves on to another form or to a report, this switchboard form is not closed, it is only ever made invsible.
Put code something like this in the unload event of the form:
Private Sub Form_Unload(Cancel As Integer)
if me.tag = "OKtoQuit" then
application.quit
else
msgbox "can't quit this"
cancel = true
end if
End Sub
Put a button on this form to quit the application, and in the code under that button, set the tag of the form before calling application.quit.
You'll want to make the message box a heck of a lot more informative, of course, and and error handling, but that's the basis of how it's usually done.
That way, no matter what object is being viewed, as long as that switchboard form is open, it will be impossible to quit the application any way other than hitting the quit button (or the 3-finger salute or the power button of your pc, of course).
Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.