×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

dynamically define sub reports within a form

dynamically define sub reports within a form

dynamically define sub reports within a form

(OP)
I have been trying many methods to go from:

me!rpt1.Report.RecordSource = SQL
me!rpt2.Report.RecordSource = SQL
me!rpt3.Report.RecordSource = SQL
me!rpt4.Report.RecordSource = SQL

to something like this

For N = 1 to 4
me!rpt[N].Report.RecordSource = SQL
Next N

but it's not working and I am pounding sand trying to figure this (should be simple) thing out.

Thanks,

RE: dynamically define sub reports within a form

I'm not sure what you are attempting to accomplish but I would suggest trying:

CODE --> vba

For N = 1 to 4
   me("rpt" & N).Report.RecordSource = SQL
Next N 

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: dynamically define sub reports within a form

(OP)
Thank you Duane!

I am working on a dynamic form that has sub reports or pillars as business likes to call them. It's a summary view of high-level data points. Each sub report currently is created manually and statically in a static location. So let's say associate 1 has pillar 2 only populated... 1, 3 and 4 are hidden. Then if they work in other pillars they are also unhidden. (That was version 1, now in version 2 we have 2 more pillars, but different business type). So now I have people who wouldn't have 1 -4 but maybe 5 or 6 showing up... the form looks like it has cancer b/c the unhidden subReport is not in the #1 spot where I'd expect.

So my re-engineering of the form I am looking at how I can cycle through the sub reports based on variable/counter driven.

Much gratitude for your prompt response to my question.
Rob

Duane, your code works like a champ!!

RE: dynamically define sub reports within a form

Glad to help a neighbor.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close