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


Tom van Stiphout

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
Cancel = True
end if

Microsoft Access MVP

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question