Setting report child's SourceObject in VB

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
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top