View Single Post
  #2  
Old May 18th, 2010, 12:53 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default How to prevent form from closing

It usually helps to post the actual code when there is a question about the
code. Why show them the X button (top right corner, not left, but I assume
you meant that) at all? You should be able to use the form's Property Sheet
to set Control Box to No (or set it to Yes, with MinMax buttons set to Yes
and Close Button to No if you want to keep the minimize and maximize buttons),
or you could set Border Style to None.

It may be possible, from what I can tell, to put something together to get
rid of the error message when the X button is clicked, but it would be a lot
of work for something that doesn't work as well as what you could have with
your own command buttons.

McHammer wrote:
Hello everybody,
I use a modal popup form to enter data in a db on which there a 2 buttons
"save and close" and "cancel". I'd like to prevent the from from closing
through the "X" button on the top left corner with unwanted/incomplete data.
Do do that I trap the use of these buttons in before update event so in the
else case I put a warning msgbox (vbOKonly) and cancel = true to prevent any
other event. So far so good. After this event an extra message of Access
advises me that the record can't be saved and if I want to close anyway the
form or not. I want to avoid this message and of course the closure of the
form. Why cancel = true is not enough to do that and what else I could do?

Thks in advance


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1