Click to See Complete Forum and Search --> : Datafiles setup for subreports


Joe L
October 7th, 1999, 04:20 PM
Hi,

I have a report with 2 subreports. The main report links 8 tables and subreports link 1 each.
When I setup report, I was told to set datafile for main and sub report separately. So I set 8 datafiles for the main, then use the following to set subreports:

numRpts = rpt.GetNSubreports

For i = 0 To numRpts - 1

SubrptName = rpt.GetNthSubreportName(i)
rpt.SubreportToChange = SubrptName
numTbls = rpt.RetrieveDataFiles

And the problem starts:
1. the "numTbls" I got is not 1 for each subreports, but 8, same as the main rpt.
2. If I set only one datafile for each subreport in the loop. I got Invalid table number error. If I set 8 datafiles as set for the main rpt, I got the same error message. If I set 8 datafiles, but this time 2-8 are empty strings. I will not get error message, but the rpt preview only shows the first page, then rest pages are blank, to actually 65535 of total?

Can anybody tell me how to solve this?

I use VB6 and SCR6.0, Access tables as db.

Thanks,