Solved

Disable close box

Posted on 2001-06-06
3
180 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now