Solved Switchboard - disable right-click close menu. (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 12:03
Joined
Sep 21, 2011
Messages
14,304
What I really want is similar to what I have in Reply #17 and what you have in Reply #10 - i.e.

If they right-click on the switchboard tab and click close, nothing happens b/c the DoCmd.CancelEvent catches it.

But if they click the red X on the Access Application, it should close with no message.

I just can't figure out how to do that, b/c I can't see how to set a flag from the Red X to run the switchboard unload event.

What I have is where if they close it the form re-opens, but it might take 60 seconds to start re-opening, but it's better than I started with.
I believe you can disable that x button, and then just use your own button?
 
Local time
Today, 07:03
Joined
Feb 28, 2023
Messages
628
I believe you can disable that x button, and then just use your own button?
Yes, you can and that would be an option:

It is more of an inertia thing. We've been using the X button to close Access for over 20 years. I don't want to have to tell everyone "The close button is disabled and you have to close Access using the close button on the switchboard, b/c there is a right-click menu to close the switchboard that I can't disable and the switchboard needs to stay open."
 

acmefinishing

New member
Local time
Today, 06:03
Joined
Oct 30, 2019
Messages
8
I think you should be testing for vbYes, not True?
Yes, exactly, I just threw the response together real fast without testing it. I respond faster than I should without verifying if my idea will work / is correct.
 
Local time
Today, 07:03
Joined
Feb 28, 2023
Messages
628
I think it is "If Confirm = True" and "If Msgbox = vbYes", but I might be mixing VBA and javascript ...
 
Local time
Today, 07:03
Joined
Feb 28, 2023
Messages
628
Not totally solved, but I'm satisfied with it ...


I ended up setting it so that if you close the switchboard, it comes back within 3 seconds, but the system still only checks every 60 seconds to see if the logout command was issued.
 
Local time
Today, 07:03
Joined
Feb 28, 2023
Messages
628
I ran into a couple of glitches, but I think I know how to fix them - but I'm open to ideas:

  • First, I have my autoexect tied to the switchboard and the database starts with progress bars for loading and checking for updates. If I close the database with the red X, on some systems I still see these, which means the hidden form is trying to re-open the switchboard, so I think I need to set the timeout to 5 or 10 seconds instead of three to prevent this. (Or disable the red X and use my own button that I can control.)
  • Second - I'd really prefer to have a "This is not recommended are you sure?" message if you close the switchboard via the right-click menu, but I don't want that if you click the red X - but I think the close and unload events fire when you click the red X so I don't think I can do that (other than disabling the red X and adding my own close button.
 

Users who are viewing this thread

Top Bottom