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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Dynamic Report based on Crosstab Query

Status
Not open for further replies.

Jean9

Programmer
Dec 6, 2004
128
US
In a group footer section on a report, I have an ID that I need to create a subreport for. The subreport is based on a cross-tab query. And since the results of the query will change based on that ID I need to be able to create
a subreport on the fly. The number of controls for the report will change from one query result to the next which is why I cannot predefine the report to access. If someone can please direct my search for an example of creating reports on the fly, I would appreciate it.
Thank you
--
J9
 
The subject of dynamically creating forms and reports based on arbitrary recordsets is somewhat discussed in htese (Tek-Tips) fora. Using hte search feature with keyword(s) [CreateForm | CreateReport] should trun up a few threads, some of which contain actual code and references.

It is generally better to use search with keywords before posting, as the site archivves include many topics of interest and their reference can often save both you and potential responders significant time. Further, the completed threads often include extended discussion of the techniques which can broaden your understanding of the processes employed.





MichaelRed


 
One of the more flexible crosstab report solutions is at
Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
I checked through the forum prior to posting and looked at the invisibleinc.com/divFiles.cfm?divDivID=4. Everything seems to be based on the idea that I have a max number of columns. I found code that I could use based on that assumption. Maybe I didn't fully understand the flexible crosstab report solutions DB because I thought it worked in a very similar way. I'll look over it again.

But.....if it is at all possible, I wish to create the report truly on the fly with the assumption that there could be any number of controls (columns) on the report. Mr. Hookom, if you are the creator of the solutions DB could you, perchance, please provide more direction?

Thank You,
J9
 
J9,
I did create the samples at Invisible Inc (former employer).

Given any report, I expect there can only be a limited number of columns. Perhaps 12 columns will fit but the 13th would not. The Crosstab.mdb allows you to create a crosstab with 12 columns. It will then display any number of columns in the report. For instance, if only 5 columns are required, only 5 will show. If your crosstab would generate 18 columns then the first 12 would show first followed by the next 6 directly following/beneath the first 12.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top