HandsOn Writing the Report Close 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_Close event procedure:

Private Sub Report_Close()

DoCmd.Restore End Sub

2. Switch to the rptCustomers report's Design view and choose File | Print Preview. A message box will appear where you can enter an asterisk (*) to view all customers, or a first letter of a company name if you'd like to limit your records. When the report comes up, click the Maximize button to make the report window cover the entire screen. Now, close the report window. When the report closes, the Database window appears in its previous size. Without the DoCmd.Restore statement, the Database window would have been maximized.

0 0

Post a comment