HandsOn Writing the Report Deactivate Event Procedure

This hands-on uses the rptCustomers report created in Hands-On 25-1.

1. In the Visual Basic Editor Code window for the rptCustomers report, type the following Report_Deactivate event procedure:

Private Sub Report_Deactivate()

DoCmd.ShowToolbar "Printing Reports", _ acToolbarNo

End Sub

2. Open the rptCustomers report and type your criteria when prompted. Upon deactivation of the report, the code you placed in the Report_Deacti-vate event procedure will run, causing the default Print Preview toolbar that Microsoft Access normally displays to be restored and your custom toolbar to be hidden.

0 0

Post a comment