Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / September 2006

Tip: Looking for answers? Try searching our database.

Setting SourceObject for a subReport

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cbjames - 29 Sep 2006 01:07 GMT
I have a Report with series of subReports. I want to change the
"SourceObject" of the subReports based upon a value on the main report. On
the Report's detail section (where the subReport reside), on the event
"Print" I wrote the following code.

If Me.TrafficCount > 0 then
     Reports!ReportName!subReportName.SourceObject = "subReportOne"
Else
     Reports!ReportName!subReportName.SourceObject = "subReportTwo"
End If

I must be missing the proper syntax to accomplish this task. If there is a
TrafficCount I want to print one subReport if the count is "0" I want to
print a different subReport.

Any help would be greatly appreciated. THANK!
Barry Gilbert - 29 Sep 2006 02:59 GMT
I don't think you can do this in the OnPrint event. You'll have to do it in
the OnOpen event.

Barry

> I have a Report with series of subReports. I want to change the
> "SourceObject" of the subReports based upon a value on the main report. On
[quoted text clipped - 12 lines]
>
> Any help would be greatly appreciated. THANK!
cbjames - 29 Sep 2006 19:37 GMT
I will try by moving it to the OnOpen Event this evening when I am back at
the jobsite. So, you think the syntax is correct, only the Event was wrong?

> I don't think you can do this in the OnPrint event. You'll have to do it in
> the OnOpen event.
[quoted text clipped - 17 lines]
> >
> > Any help would be greatly appreciated. THANK!
Barry Gilbert - 29 Sep 2006 23:16 GMT
Yes. The syntax looks correct. As you say, it's just the order of events
that's tripping you up.

Barry

> I will try by moving it to the OnOpen Event this evening when I am back at
> the jobsite. So, you think the syntax is correct, only the Event was wrong?
[quoted text clipped - 20 lines]
> > >
> > > Any help would be greatly appreciated. THANK!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.