Prev: Autofill field on form with values from another table
Next: QBE inserts quotes instead of brackets around field names
From: Tore on 25 Mar 2010 17:56 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
From: Tom van Stiphout on 26 Mar 2010 09:44 On Thu, 25 Mar 2010 14:56:07 -0700, Tore <tore(a)nospam.nospam> 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
From: Tore on 27 Mar 2010 06:33
I tried your code and it works for me, thanks. Regards from Tore |