I want to open the main form when the database is opened, and then close the whole access application when the main form is closed.
To open the main form when openibg the database
Tools , startup
select your form from the display form/page dropdown box
deselect the display database check box...