Link to home
Start Free TrialLog in
Avatar of ANDREAG
ANDREAG

asked on

Disable close box

Is there any way to prevent users from closing a form using Escape or the close button (top right). I have a Close button which I want them to use instead.

I have tried putting code into the Queryclose event, but once this event is started, can it be stopped?

Thanks,
Andrew.
ASKER CERTIFIED SOLUTION
Avatar of sloeber
sloeber
Flag of Belgium 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 KAK
KAK

If you would like to let the user know why they can't close with ESC, build on the solution provided by sloeber by adding a return message to @Failure in the Input Validation foumula.  

Example: @If(AllowClose = "0"; @Failure("Please use the \'\'Close\'\'  button to close this document."); @Success)
make sure that you use the continue = False to stop from the form being closed after checking the field value set by the @functions in the previous events.

-Arun