Access: The Switchboard Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

"It's not confidence, ma'am; it's honesty"

Database Tools ->Visual Basic

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.