Passing a parameter value using OCX 
Author Message
 Passing a parameter value using OCX

Dear All

I have a form from which the user selects a PO Number.  This PO Number is
stored in a variable, called strPONumber, which I am trying to use with the
ParameterFields property as follows:

With CrystalReport1
        .ReportFileName = App.path & "\PO.RPT"
        .Connect = App.path & "\PO.MDB"
        .DiscardSavedData = True
        .RetrieveDataFiles
        .ParameterFields(0) = "PONumber;' " & strPONumber & " ';TRUE"
'<<<<< problem???!!!
        .ReportSource = crptReport
        .ReportTitle = "Purchase Order ' " & strPONumber & " ' "
        .Destination = crptToWindow
        .PrintFileType = crptCrystal
        .Action = 1
    End With

However, I am prompting for the parameter value, even though I have set the
SetDefaultValue = TRUE.

Is my syntax for ParameterFields correct?  Why do I keep being prompted?

Rgds
Daisy



Tue, 07 Jun 2005 11:24:19 GMT  
 Passing a parameter value using OCX
try using this syntax :

With CrystalReport1
  .ParameterFields(1).AddCurrentValue (X)
  .ParameterFields(2).AddCurrentValue (Y)
  ........ and so on.

Gregor Heidinger.


Quote:
> Dear All

> I have a form from which the user selects a PO Number.  This PO Number is
> stored in a variable, called strPONumber, which I am trying to use with
the
> ParameterFields property as follows:

> With CrystalReport1
>         .ReportFileName = App.path & "\PO.RPT"
>         .Connect = App.path & "\PO.MDB"
>         .DiscardSavedData = True
>         .RetrieveDataFiles
>         .ParameterFields(0) = "PONumber;' " & strPONumber & " ';TRUE"
> '<<<<< problem???!!!
>         .ReportSource = crptReport
>         .ReportTitle = "Purchase Order ' " & strPONumber & " ' "
>         .Destination = crptToWindow
>         .PrintFileType = crptCrystal
>         .Action = 1
>     End With

> However, I am prompting for the parameter value, even though I have set
the
> SetDefaultValue = TRUE.

> Is my syntax for ParameterFields correct?  Why do I keep being prompted?

> Rgds
> Daisy



Thu, 09 Jun 2005 19:08:50 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing a Value to a Parameter in VB6 using ADO

2. Passing parameter from Crystal OCX to a report that uses a stored procedure

3. Passing Parameters to stored parameter queries using VB 5's Data Controls

4. Passing parameters to SQLServer using a Pass-Through query

5. How to pass single, multiple or null parameter value(s) to multiple queries

6. Web Services parameter passing - setting default values?

7. Passing value to numeric parameter from VB

8. Passing parameters to VB application and get return value from it

9. Passing variable value as parameter

10. Frames and ASP and passing parameters / values

11. Passing Hexadecimal value as parameter

12. Passing Hexadecimal Value as parameter

 

 
Powered by phpBB® Forum Software