All code in a report is contained in the Code Module. The Code Module contains all the event handlers for objects contained in the Report. There is also a global section that can contain module level events, declarations, procedures and functions. This part of the Code Module is visible from the Module view of the Code Explorer.
The programs and variables declared in the global section of a module are visible to all subreport code modules in the report.