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

Generating Subreports with VBA

Status
Not open for further replies.

speedymercial

Programmer
Oct 13, 2002
3
DE
How can I generate subreports using only VBA. I have a report created with VBA, including several controls and the recordsource-SQL.
All within a "sub"-procedure. No I want to create subreports within this main report and - if possible - within the same procedure.

Any Ideas

Best regards
 
Hi

Before I proceed, let me say I have not done this before, but..

I would think you create the (sub) report itself, using CreateReport (presuambly as you have done for the main report, since fundamentally there is not difference between a report and a sub report, it is simply the fact that it is contained within asubreport control, which make a report into a (sub)report. Then on thae main report, cerate a subreprot control using CreateReportControl, with control type acSubform (since there does not seem to be an acSubReport constant) and set the sourceobject proeprty of the subreport control you have just cretaed, to the relevant (sub)reportname

Hope that helps Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top