Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Posts
    3

    Unanswered: Crystal Report 8.5 Error

    i'm using VB 6 and for reports Crystal Report 8.5 the problem is that I have this report which is passing parameters to the report.
    The error that I get when the applications steps into the parameter is Subcript out of range.

    Find below part of the script:

    With Report
    .ParameterFields(1).AddCurrentValue (Val(Text1.Text))
    .ParameterFields(2).AddCurrentValue Val(Text2.Text)
    .ParameterFields(3).AddCurrentValue Val(Text3.Text)
    .EnableParameterPrompting = False
    .Database.SetDataSource rstemp
    .Database.Verify

    Can you please help resolve this problem?!!!

  2. #2
    Join Date
    Oct 2003
    Posts
    357
    Try this


    With Report
    .ParameterFields(0).AddCurrentValue (Val(Text1.Text))
    .ParameterFields(1).AddCurrentValue Val(Text2.Text)
    .ParameterFields(2).AddCurrentValue Val(Text3.Text)
    .EnableParameterPrompting = False
    .Database.SetDataSource rstemp
    .Database.Verify

  3. #3
    Join Date
    Jan 2005
    Posts
    3
    I have done so, thing is I'm not sure what to do. I have added three parameters on the report, question should I now link them with items on the report?

    Cause the I'm now getting an error; the field name is unknown!!!

  4. #4
    Join Date
    Oct 2003
    Posts
    357
    Make sure you have no other parameters

    Madhivanan

  5. #5
    Join Date
    Feb 2005
    Posts
    3
    Reference them by name like this:

    .ParameterFields("Param1").AddCurrentValue (Val(Text1.Text))
    .ParameterFields("Param2").AddCurrentValue Val(Text2.Text)
    .ParameterFields("Param3").AddCurrentValue Val(Text3.Text)

  6. #6
    Join Date
    Mar 2003
    Posts
    2

    Thumbs up Field name is unknown

    Quote Originally Posted by Madhivanan
    Make sure you have no other parameters

    Madhivanan

    Ok, for your answer, but I tried it, Some times it will work, ie it wont show error, sometimes it shows error. tell some other reply

Posting Permissions

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