
DataSource Help Please, Please, Please
I'm using this to run a report:
.DataFiles(0) = (frmParent.CMDialog1.FileName)
.DataFiles(2) = App.Path & "\" & "donotdel.mdb"
.ReportTitle = "Invoices Over " & Days & " Days Due"
.SelectionFormula = "CurrentDate - {Splits.InvoiceDate}
Quote:
>"&Days
.Action = 1
Exit Sub
Whenever I try to run a report with a single datafile source after I
haverun the above report I get a 20506 Error (which I believe means
I'm trying to refer to a table thats out of range). The documentation
says that the datafiles(x) properties should be cleared out after the
report prints, but I'm almost sure that is not happening. I belive
the subsequent report is trying to refer to a non-existant element in
the array. If I remove the .DataFiles(2) line, everything schmoozes
along just fine. I need to be able to point to the datafiles though.
Is there as way I can manually eleminate offending property at
runtime? Something like .DataFiles(2).PleaseGoAwayNow = True ??
The only sleazy hack I can think of is to unload and load the Crystal
Control between reports but that is expensive in terms of time and
resources.
I'd be grateful for any input. Be gentle with me, I'm kinda a rookie.
Thanks in advance.