Specify Database Location of subreport
Hello,
I have a report with a sub-report but when specifying the location for the subreport it fails saying table doesn't exist. When I remove subreport it works fine. Both main and subreport use the same table, here the code...
Set Report = New CRProgMaqImp4
Report.Database.Tables(1).Location = "wcajtot" & RsUsu.Fields("Usuario")
Set crSubReport = Report.OpenSubreport("Tarimas")
crSubReport.Database.Tables(1).Location = "wcajtot" & RsUsu.Fields("Usuario")
Thanks.
Re: Specify Database Location of subreport
Try :
Code:
Set crSubReport = Report.OpenSubreport("Tarimas")
For K = 1 to crSubReport.Database.Tables.Count
crSubReport.Database.Tables(K).Location = "wcajtot" & RsUsu.Fields("Usuario")
Next K
Re: Specify Database Location of subreport
Thanks jggtz, it didn't worked using this way, I solved problem using other way...
on the subreport i was using "INNER JOINS" between tables, what i did was added additional fields on the master table to prevent the use of JOINS, it worked fine with the same code.
Many thanks.