By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,581 Members | 1,990 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,581 IT Pros & Developers. It's quick & easy.

Multiple instances of subreport

P: 1
In Microsoft Access 2013 I have a report with multiple instances of the same subreport. Based on which control contains the subreport, I would like to apply a different filter using code. (This would prevent having to create multiple queries and subreports that would be very similar.) From within the subreport, is there a way to know which control in the parent report contains it? I would think there would be some sort of "parent" property, but I can't figure out what.
3 Weeks Ago #1
Share this Question
Share on Google+
2 Replies

P: 30
I think not.
I would run some code in the main report that sets the filter for each subreport.
3 Weeks Ago #2

Expert Mod 15k+
P: 31,561
No. There is a Me.Parent, but it refers to the Report itself rather than the SubForm/SubReport Control that the instance of the Report is contained within.

What is it that you desire to trigger the setting of the Filter? Having code in the main Report would be an option in some circumstances. If it's an Event in the Report used as the SubReport then it might make sense to give each instance a value in one of the Properties to enable you to identify it when it's active. The .Tag property is often available for this but check other possibilities. There may already be something set you can rely on without having to set it specifically for this reason.
3 Weeks Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.