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  

Prevent user to close tabbed form



 
 
Thread Tools Display Modes
  #1  
Old March 25th, 2010, 10:56 PM posted to microsoft.public.access.forms
Tore
external usenet poster
 
Posts: 12
Default Prevent user to close tabbed form

rI use the tabbed form layout in access 2007, i.e. I went to Access options
-current database and chose "Tabbed documents". One form is a startup fom
and the main menu of my application. By right-clicking on the main menu tab
the user can choose "Close" and the main menu is shut down.

How can I prevent the user from closing down the main menu form of my
application?

Regards
  #2  
Old March 26th, 2010, 02:44 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Prevent user to close tabbed form

On Thu, 25 Mar 2010 14:56:07 -0700, Tore wrote:

I would argue that if they close it, you should close the whole
application. If we prevent the user from closing it, how can she close
the application?
Anyway, that aside, try this in the Form_Unload event of that form:
if msgbox("Are you sure you want to close the application?",
vbQuestion or vbYesNo) = vbYes then
DoCmd.Quit
else
Cancel = True
end if

-Tom.
Microsoft Access MVP




rI use the tabbed form layout in access 2007, i.e. I went to Access options
-current database and chose "Tabbed documents". One form is a startup fom
and the main menu of my application. By right-clicking on the main menu tab
the user can choose "Close" and the main menu is shut down.

How can I prevent the user from closing down the main menu form of my
application?

Regards

  #3  
Old March 27th, 2010, 11:33 AM posted to microsoft.public.access.forms
Tore
external usenet poster
 
Posts: 12
Default Prevent user to close tabbed form

I tried your code and it works for me, thanks.

Regards from Tore
 




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 12:13 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.