Reports with subreports and if statement

Kenneth

Registered User.
Local time
Today, 00:43
Joined
May 31, 2000
Messages
10
I'm using Access 97. I have a report that displays a number on my report. And the number desides whether subreport 1 should be displayed or subreport2 should be displayed.
I can do this with the form, but are unable to do it with the reports. As the reports don't have a OnCurrent event. I can not change the source-object of a subreport with the OnFormat and OnOpen event. Any ideas on how to do this with reports, and I'm for ever grateful.
 
Add both sub reports to the Main report. On the Report_Open event evaluate which sub report and hide the one that is not needed. Make sure you also set its Hieght to 0.
 
Create an unbound subreport, then at runtime set the 'sourceobject' property to whichever report you want to show. Think you need to assign design permissions to the users for the main form though.
 

Users who are viewing this thread

Back
Top Bottom