crystal report subreport in visual basic

Dear Expert,
I can't add subreport into crystal report template in visual basic. Do you have any example of subreport in visual basic using crystal report. The code is as follows:
   
Dim rpt As New rptProfile, f As New frmReport, rs As New ADODB.Recordset, rptFather As New rptFather
   sSQL = "SELECT PersNo, Rank,  NameEnglish, NameBangla, Picture, Decoration, ArmsSvc, " _
   & "Unit, Station, Course,CommissionDate, AntiDate,RetDateByAge,  RetDateByService, " _
   & "PresentRankDate, GcNoAcademy, ApptAcademy, BirthDate, BirthPlaceDist, " _
   & "BirthPlaceCountry, Hieght, Weight, BloodGP, MedCat, IDMk, Religion, Ethnic, PassportNo, " _
   & "IssueDate, IssuePlace, ContactNoTel, ContactNoMobile, Email, PresentHouseNo, PresentRdNo, " _
   & "PresentSecNo, PresentVill, PresentPo, PresentUzThana, PresentDist, PermanentHouseNo, " _
   & "PermanentRdNo, PermanentSecNo, PermanentVill, PermanentPo, PermanentUzThana, " _
   & "PermanentDist, TINNo, DetailsSyInfo, Piculiarity, Others, Remarks " _
   & "FROM PersonalInformation Where PersNo = '" & cboPersNo.Text & "-" & txtPersNo & "'"
   Set rs = Cn.Execute(sSQL)
   If rs.EOF Then
       MsgBox "No Records to display in the report...", vbInformation
       Exit Sub
   End If
   
   Screen.MousePointer = vbHourglass
   rpt.Database.Tables(1).SetDataSource rs
   
   sSQL = "SELECT r.Fullname,b.BirthDate,b.AppxAge, b.BirthPlace,b.Nationality,b.Religion," _
   & "b.PermanentHouseNo,b.PermanentRoadNo,b.PermanentSec,b.PermanentVill,b.PermanentPo,b.PermanentUzThana," _
   & "b.PermanentDist,r.PresentHouseNo,r.PresentRoadNo,r.PresentSec,r.PresentVill," _
   & "r.PresentPo,r.PresentUzThana,r.PresentDist,b.HigestEduQua,s.LastOccupation," _
   & "b.PoliticalParty,b.politicalAppt,s.PersNo,s.LastDept,s.Rank,b.DependancyOnOffice " _
   & "from RelativeBiography b, RelativeInfo r,RelativeService s " _
   & "WHERE r.Rel_id *= b.Rel_id AND r.Rel_id *= s.Rel_id AND r.EmpPersNo = '" & cboPersNo.Text & "-" & txtPersNo & "'"
   Set rs = Nothing
   Set rs = New ADODB.Recordset
   Set rs = Cn.Execute(sSQL)
   rptFather.Database.Tables(1).SetDataSource rs
   f.CRV.ReportSource = rpt
   f.CRV.ViewReport
   f.WindowState = vbMaximized
   Screen.MousePointer = vbDefault
   f.Show 1
raju1Asked:
Who is Participating?
 
mlmccCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.