From Here to Eternity
Here is some more practice: add DoCmd.Close to all of
the event procedures for each command button we added to the forms.
Here are the steps:
Try it: Edit Your Code
Open the form in Design View.
Go to Database Tools ->Macro
Select:Convert Form's Macros to Visual Basic
Select the Button Control.
Open the Property Sheet.
Look for the On Click Event Procedure.
Open the Visual Basic code by clicking on
the three-dot builder.
Type DoCmd.Close in the line before:
DoCmd.OpenForm "Movies",
acNormal, "", "", , acNormal
Save your changes.
Test your software to see if each button opened and
closed the right forms.