Link to home
Start Free TrialLog in
Avatar of DMills9866
DMills9866

asked on

Access Application Window - how to hide the close button

I am wanting to hide the Close Button on the Access Application Window for the application that I am building.  Does anyone have the code to do this?
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DMills9866
DMills9866

ASKER

I had found code to gray out the Access Application's close button, so in this design that I have, I will use that methodology.  However, I do like your suggestion above, and will notate that for future projects.

thanks
You can disable the close button with the Windows API:

http://support.microsoft.com/kb/300688

Hiding it is another story<g>.

I use the technique Dale suggested and sometimes along with disabling.

However I use a hidden form at startup, called frmGlobal.  This has a check box "OK to close", which get's set by my application exit code (called from the menu, toolbar, etc)
.

  Code in the unload event of frmGlobal makes sure this is set and if not, messages the user and cancels the close.

Since this is the first form opened by the application, it's the first that tries to close, so it catches things early.

Jim.
Jim,

"Since this is the first form opened by the application, it's the first that tries to close, so it catches things early."

I had never really tested that, assuming that the last opened would be the first that Access would try to close.

I was also unaware of the API, so will have to check that out as well.  Any idea whether that works without modification on x64 and Office 64 systems?
<<I had never really tested that, assuming that the last opened would be the first that Access would try to close.>>

 No.  It goes by the ordnial in the Forms collection.

<<I was also unaware of the API, so will have to check that out as well.  Any idea whether that works without modification on x64 and Office 64 systems? >>

 Both declares need to be updated for 64 bit.

Jim