Multiple Subreports - 1 Main Report

G

Gary Dolliver

Hi all,
I have one report that I would like to bring up a different subreport,
depending on a value for field Order_Product_ID (OPI). For example, if OPI =
1, I would like subreport 1 to appear, if OPI = 2, then I would like
subreport 2 to appear, and so on. I tried using a similar approach that i
got to work with my forms, but I do not have the same events, such as onLoad,
and onCurrent. Any help is always appreciated! Thanks!
-gary
 
K

Klatuu

Use the OnFormat event of the section the subreports are in and make them
visible or invisible based on your criteria.
 
G

Gary Dolliver

Thanks for the reply. I am now having a problem with my syntax, can you
please help?
I have the following:
If Order_Product_ID = 1 Then
Me.SubPrice.SourceObject = "REPRODUCTION_FORM_Book_Pricing"
Else
Me.SubPrice.SoourceObject = "REPRODUCTION_FORM_Other"
End If

but I keep getting runtime errors (438)... I have the above in the OnFormat
event for the detail record. Please help!
-gary
 
K

Klatuu

You can't change the SourceObject of a sub report control in the load or the
format events of a report. I would have both sub reports on the report and
use the Visible property of the subreport controls present the one I want to
show.
 

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