Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding sub reports to report in OnFormat??

Status
Not open for further replies.

emilybartholomew

Technical User
Aug 3, 2001
82
0
0
US
Hi-

Does anyone know if there's a way to add a sub report to a report at runtime, in the OnFormat event of a section of a report?

My problem is this: I have a table containing many projects from different years. Some of these projects are continuations of each other through years. For example, Project A in 2000 led to Project B in 2001. In some cases more than one project led into another one (e.g. Project B and Project C - both from 2001 - morphed into Project D in 2002) Because there is not always a one-to-one mapping from old project to new project, I have created a new table that links "Project" to "Old_Project" (so in the example above the table would look like this:
Project Old_Project
B A
D B
D C

Now I'm supposed to make a report that lists each project from the current year with all of it's predecessors. In the example this would be:
Project D, 2002
Project C, 2001
Project B, 2001
Project A, 2000
all in succession.

The main problem is that the relationships can go back five years, or two or none (and in the future it will be more), and there could be one predecessor per year or more.

I'm thinking if I can write a program in VB to determine which Project I need to include next (this I can do) and then print a sub report that contains that Project, that would be cool.

Does anyone know if this is possible?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top