Refer out of scope expression

  • Here is my Expression that is trying to refer something out of scope:

    =iif(Fields!fee_name.Value<>"monthly"

    , StrConv(Replace(Fields!fee_name.Value,"_"," "), VbStrConv.ProperCase)

    , iif(ReportItems("Text58").value > Fields!fee.Value

    , StrConv(Replace(Fields!fee_name.Value,"_"," "), VbStrConv.ProperCase) &" (" & FormatCurrency(Fields!fee.Value) & ")"

    , StrConv(Replace(Fields!fee_name.Value,"_"," "), VbStrConv.ProperCase)

    )

    )

    It is giving me an error

    Error 2 [rsReportItemReference] The Value expression for the text box ‘fee_name’ refers to the report item ‘Text58’. Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope. Letters in the names of report items must use the correct case.

  • The error message seems self-explanatory: what is your question?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • What do i need to do to get rid of this error?

  • I suggest that you read this to help your understanding of scope.

    I can't give a specific answer, because that would require me to look into the design of your report.

    But, based on the error message, it seems that the expression is being evaluated at a point in the report where the Text58 field is not defined or invalid.

    As an aside, it is good practice to give your controls meaningful names: 'Text58' means nothing and is difficult to maintain.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I am trying to fix this, can you please pass me your email address if possible I would like to set up a Web ex with you. It would be greatly appreciated.

  • Rename the TextBoxes to your own variable name and then you can reference them. Doesn't make much sense, but it works. 😀

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply