A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to prevent form from closing



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 18th, 2010, 09:22 AM posted to microsoft.public.access.forms
McHammer
external usenet poster
 
Posts: 4
Default How to prevent form from closing

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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.