Dim r As New rptMain
r.SetDataSource(dsMain.Tables(0))
Dim rr As New rptSub
r.Subreports(0).SetDataSource(dsDetal.Tables(0))
CrystalReportViewer1.ReportSource = r
When a add .Tables(0) to the subreport it is ok... ---> This line r.Subreports(0).SetDataSource(dsDetal.Tables(0))
previously it was
r.Subreports(0).SetDataSource(dsDetal)