HandsOn Writing the Form Deactivate Event Procedure

1. In the Visual Basic Editor window, double-click Form_Employees.

2. In the Code window there are a number of event procedures and functions already written for this form. Enter the following Form_Deactivate event procedure below the last procedure code.

Private Sub Form_Deactivate()

DoCmd.ShowToolbar "Print Preview", acToolbarYes End Sub

3. To test the above event procedure, activate the Employees form in Form view. Now switch to the Database window. Notice that the Print Preview toolbar is visible.

4. Turn off the Print Preview toolbar by choosing View | Toolbars | Print Preview.

5. Close the Employees form.

0 0

Post a comment