Search code examples
vb6crystal-reportssubreport

Record Selection Formula in subreport vb6.0


I have a crystal report rpt1. I am using rpt1 as subreport of rpt2. I have following selection formula in my rpt1

rpt1.RecordSelectionFormula = " {BANK.PRID}= " & PRID & " "

Here Bank is a tbale Name

It works fine when it(rpt1) is used as independent report but when it is used as subreport of rpt2. the formula does not work. How can I apply selection formula in sub-report? i could not find enough help from google.


Solution

  • YOu should use OpenSubReport to access your subreport in main report. Try this.

    rpt2.OpenSubreport("rpt1").RecordSelectionFormula="{BANK.PRID}=" & PRID & ""