>>>Please read carefully... there are a few subtleties to what I am trying to accomplish...
>>>I will be happy to answer any questions to clarify my objectives prior to awarding points.
I am in the process of shrinking the report code modules for a number of reports and subreports by moving the common code out of duplicate event handlers into functions in my stand-alone code modules. This speeds stuff up and also makes the code much easier to maintain, since I can eliminate duplicate event handlers, and just maintain a single function in the stand alone modules.
The resulting functions are set in the appropriate property sheet in the reports/subreports as an event handler... For example, I might set an Open Event handler to be:
=InitReport([Name]) or similar
In the InitReport() function, I would use the passed Name to access the Reports collection to get a reference to the specific report and its controls. e.g., Reports(RptName) or similar
The above approach will work fine with a top level report, but it will *not* work for subreports, because it appears that subreports do not show up in the Reports() collection, so referring to
Reports(SubreportName) in InitReport() will generate an error.
It also appears that I cannot pass a direct reference to the Me object if I wanted to rework InitReport() to take a Report parameter instead of a string parameter. Correct? (e.g., =InitReport(Me) )
***MY QUESTION***
So, is there anyway to migrate these duplicate event handlers from my *subreports* to the stand-alone modules? (Maybe I am stuck with having the duplicate event handlers???)
-Steve
Start Free Trial