pass val from vb to crystal report

i have a stored procedure with single parameter. From crystal report when i pass the parameter i get the output. but i cannot pass the parameter from vb to this crystal report. PLS HELP

Dim CrApp As CRAXDRT.Application
Dim CrRep As CRAXDRT.Report
Set CrApp = New CRAXDRT.Application
Set CrRep = CrApp.OpenReport("C:\JSM.rpt")

CrRep.ParameterFields.GetItemByName("@strOrderNo").AddCurrentValue "YIOP2795776"   ERROR HERE

CRViewer1.ReportSource = CrRep
Who is Participating?
Try it as
CrRep.ParameterFields.GetItemByName("{?strOrderNo}").AddCurrentValue "YIOP2795776"

If that doesn't work add this to get the name

msgbox CrRep.ParameterFields(1).Name

Since it is the seems to be the only parameter
CrRep.ParameterFields(1).AddCurrentValue "YIOP2795776"

Éric MoreauSenior .Net ConsultantCommented:
is it the same question you posted 4 times?
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.