It's basically checking if the form is hidden or not, then running the check to see if it is and exiting all together if true.
If you aren't going to do the hidden form approach you will need to always have the switchboard open and modify it to suit your needs.
I went with the hidden form approach, so here is the objects that I have.
A Module in the VBE with
Code:
Option Compare Database
Public pboolCloseAccess As Boolean
A form entitled - hfrmcloseaccess
The code on this form below
Code:
Private Sub Form_Unload(Cancel As Integer)
'Trigger the unload when this form is still open
'This prevents users from exiting the application with the
'closes(X) on the top right itself
If Not pboolCloseAccess Then Cancel = True
End Sub
Private Sub Form_Open(Cancel As Integer)
'Makes the public function pboolCloseAccess as false
pboolCloseAccess = False
End Sub
a Macro entitled AutoExec with
1) Open form hfrmCloseAccess with Hidden in the Window Mode
2) Open form whateveryourform is with the exit button with Normal in the Window Mode
You don't need to set the form to auto open to whatever in the options, let the macro do that (above)
So now you technically have both forms opens with one hidden, the form open event would trigger and set the boolean and the code would fire to prevent you from exiting through top right x or right click on taskbar and close since the form is open.