pass val from vb to crystal report

Posted on 2011-05-11
Last Modified: 2012-08-14
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
Question by:AnnaJames77
    LVL 69

    Expert Comment

    by:Éric Moreau
    is it the same question you posted 4 times?
    LVL 100

    Accepted Solution

    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"


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now