Link to home
Start Free TrialLog in
Avatar of huston8481
huston8481

asked on

Dynamic subreport group level control source

Using Microsoft Access 2000

Is it possible to dynamically set the Group Level Control source of a subreport?

Essentially,

Given two reports where rptSubMain is a subreport of rptMain
rptMain
rptSubMain

Is it possible, based on outside parameters from a form or the main report, to dynamically set the group level of rptSubMain?

So, in rptMain

Me.rptSubMain.Report.GroupLevel(0).ControlSource = ""

This statement gives an error message 2455 saying the expression has an invalid reference.

I've tried everything but always end up with errors saying that I cannot change the property while printing, or the report is not open or non-existent.

I'm not looking for sorting or filtering here, I need it to actually Group because the subreport is doing totals and averages based on a different query than the main report.
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

huston8481,

Yes, but it is *much* easier to just insert two subreports and simply toggle the visibility.

Here is a sample

JeffCoachman
AccessEEQ-24127818DynamicGroupSu.mdb
Avatar of huston8481
huston8481

ASKER

Jeff,

Thank you for your response.  Unfortunately I could not open your sample with Access 2000 or Access 2002.  Was your sample created in a higher version?
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks again.