Results 1 to 5 of 5

Thread: ***RESOLVED***This array must be subscripted.

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    Sunny Scottsdale Arizona
    Posts
    254

    ***RESOLVED***This array must be subscripted.

    I am passing multiple parameters (ID's) using an array to a Crystal Report. I am receiving the following message when running my code:

    "Crystal Report Viewer"

    "This array must be subscripted. For example: Array [i]."

    Here is my code:
    Code:
    Private Sub SettleSched_Par()
    
        Dim strInput As String
        Dim strValues() As String
        Dim i As Integer
            
        '--------Encapslulated code opens cr report--------
        Dim Report As New rptFundBuySched
        Dim crPDefs As CRAXDRT.ParameterFieldDefinitions
        Dim crPDef As CRAXDRT.ParameterFieldDefinition
    
        Set crPDefs = Report.ParameterFields
        
        For Each crPDef In crPDefs
            With crPDef
                Select Case .ParameterFieldName
                    Case "TradeIDParm"
                        'Get the ID's.
                        strInput = InputBox("Enter trade ID's seperated by commas.", "Enter Trade ID's")
                        
                        'Split them into an array.
                        strValues = Split(strInput, ",")
                        
                        'Add parameter(s).
                        For i = 0 To UBound(strValues)
                            .AddCurrentValue CDbl(strValues(i))
                        Next i
                End Select
            End With
        Next
    
        Report.EnableParameterPrompting = False
        frmRptView.CRViewer1.ReportSource = Report
        frmRptView.Show
        frmRptView.CRViewer1.ViewReport
        '-------------------------------------------------
    
    End Sub
    I have the parameter in the report set to 'Allow Multiple Values'.

    Help appreciated. Thx
    Last edited by Jefftopia; Jul 30th, 2007 at 03:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width