Solved

Disable close box

Posted on 2001-06-06
3
183 Views
Last Modified: 2013-12-18
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.
0
Comment
Question by:ANDREAG
3 Comments
 
LVL 4

Accepted Solution

by:
sloeber earned 30 total points
ID: 6159698
How do you force a user to use a button to close a form?

This code satisfies three requirements:
1) prevent users from closing a form via menu or keyboard controls; only the action button can be used for closing
2) only use ONE field to accomplish to keep application overhead down
3) depending on a value in a status field, action button should issue file close

AllowClose field: Editable, Text, Hidden


  Default value = "0"
  Validation = @If(AllowClose = "0"; @Failure(...); @Success)
Action Button:
  FIELD AllowClose := "1";
  ...........

Form PostOpen Event:
  FIELD AllowClose := "0";
  @SetField("AllowClose"; "0")

That's all

Greets,
Sloeber



0
 

Expert Comment

by:KAK
ID: 6161021
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)
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6173221
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
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question