selection formula not working in subreport

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mabubakarpk
    New Member
    • Feb 2007
    • 62

    selection formula not working in subreport

    Hello to All,

    I am using crystal report 8 and vb 6. I am passing query and selection formula to subreport. query working fine but selection formula not effecting on report.

    If I use link subreport from MainReport.rpt & Subreport.rpt from crystal report then subreport shows data fine. but when I use selection formula from vb6 It duplicate records in subreport.
    Code:
           With CrystalReport
               .Connect = "Connection string" 
               .ReportFileName="Mainreport.rpt"
               .SQLQuery = "select * from table"   
        
               .SubreportToChange = "SubReport"
               .SQLQuery = "Select * from table"
               .ReplaceSelectionFormula ("{tb.EMPNO} = {?Pm-tb.EMPNO}")            
               .Action = True
    
           End With

    Any help with advance thanks
Working...