(cr8.5(RDC), VB6, Access 2000)
Hi,
How can I change the datasource of a subreport between 2 recordset at runtime ?
Im using this :
request1 = "Select ... "
Recordset1.Open requete, db, adOpenStatic, adLockOptimistic
request2 = "Select ... "
Recordset2.Open requete, db, adOpenStatic, adLockOptimistic
if Condition1 = True Then
Set CRSubreport = Report.OpenSubreport("subreport1"
CRSubreport.Database.SetDataSource Recordset1
else
Set CRSubreport = Report.OpenSubreport("subreport1"
CRSubreport.Database.SetDataSource Recordset2
end if
The first time i run the report, everything is ok, but the second time (without leaving the program) the setdatasource dont seem to change.
Another question that could solve my problem. What's wrong with that line :
CRSubreport.RecordSelectionFormula = "not isnull({ado.Date})"
Error : "This field name is not known"
Thanks,
Frank