The following event procedure runs when the Customer Maintenance window closes. It closes the Customers And Prospects lookup window if it’s loaded:
Private Sub CustomerMaintenance_AfterClose() If CustomersAndProspects.IsLoaded = True Then CustomersAndProspects.Close End If End Sub