I'm trying to edit an expression on an existing form we use. The field in question currently only has a simple =SWITCH expression. I want to add an additional expression either nested in the SWITCH or any other way really, that will check an additional field value from the same DataSet1, and print out additional T.O.S info based on the commodity below the existing text. Currently, the expression looks like this:
=SWITCH(First(Fields!Origin_country, "DataSet1") = "USA",
"***PRINTS US VERSION OF TERMS OF SERVICE AGREEMENT***"
& vbCrLf &
"More text goes here...",
--Need to add nested expression to check a different field value from dataset 1.
First(Fields!Origin_Country, "DataSet1") = "CAN",
"***PRINTS CDN VERSION OF T.O.S***"
& vbCrLf &
"More text goes here..."
--Need to add nested expression to check a different field value from dataset 1.
) -- Closing bracket from =SWITCH
I tried adding the additional Field values within the existing =Switch, but i get the error: "Paragraphs[0].TextRuns[0]’ contains an error: [BC30201] Expression expected." Tried adding an IIF statement within the =SWITCH but i get this error instead: "The Value expression for the text box ‘textbox28’ refers directly to the field ‘cmd_code’ without specifying a dataset aggregate. When the report contains multiple datasets, field references outside of a data region must be contained within aggregate functions which specify a dataset scope. "
The Field Value i want to check include 9 commodity codes which i can reduce to 2 as LIKE "PRO*" and LIKE "SEAFOO*" (Produce and seafood). They all fall under produce commodity so they will all have the same True result printed out below the existing T.O.S; 1 with US T.O.S and the other Canadian...
Thank you!