Setting report child's SourceObject in VB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using Access 2003...

I have a master report (rptMaster) that has the header and footer I want for
every report. This master report also has an unbound child window. I create
sub reports that I use to actually populate the reports. I want to
dynamically change what sub report is the source object for that master
report depending on which command buttin I click. I'm hitting my head on the
wall for the VB code for this. Any ideas?

TIA

Aaron G
Philadelphia, PA
 
Aaron said:
Using Access 2003...

I have a master report (rptMaster) that has the header and footer I want for
every report. This master report also has an unbound child window. I create
sub reports that I use to actually populate the reports. I want to
dynamically change what sub report is the source object for that master
report depending on which command buttin I click. I'm hitting my head on the
wall for the VB code for this. Any ideas?


First, the code must be in the main report's Open event
procedure.

You can probably pass the source object setting from the
form to the main report using the OpenReport method's
OpenArgs argument.

The code in the Open event could be something like:

Me.subreportcontrol.SourceObject = Me.OpenArgs
 
Back
Top