Ah. You're trying to pass the OpenArgs from the main to the sub report.
There is a timing issue there, i.e. Access opens the subreport before the
main report.
Applying the main report's filter to the sub is a perennial problem. The
simplest workaround is usually to use a form where the user enters all the
applicable criteria in different controls, and then have the subreport's
source query read the values from the form. The query contains things like:
SELECT * FROM MySubTable WHERE SomeField = Forms!MyForm!SomeControl;
Although I have not tried using OpenArgs as you suggest, it would be
possible. If we are talking about a single value always applied to the same
field of the subreport, you could put a Text box on main report with
ControlSource of:
=[Report].[OpenArgs]
and name it in the LinkMasterFields property of the subreport, with the
sub's matching field in LinkChildFields.
If it is a complex argument, is should be possible to parse the values in
Report_Open, write them to a number of unbound text boxes, and assign
LinkMasterFields/LinkChildFields.
For really involved criteria where none of these approaches are suitable,
you do have another possibility. Assuming the user always opens the report
from a form, you can simply write the SQL property of the query the
subreport uses so that it returns only the desired records for this run.