Hi,
I've a query contains many fields & calculated fields, I used many iifs to check it a specific field value is equal to a field name to return the record value.
The iifs are limited to 13 iffs and when I added the 14th one I got an error message that the expression is too complicated, so I decided to change it to a function with case statements.
I created such function to check if the specific field value is equal to a field name to return the record value from that field.
I called this function on the query but unfortunately the returned value to the query was the called name (e.g. [B]) not the value of the field [B]
Example:
Where A, B & C are fields nameCode:Function SetMultiplier(Multiplier As String) As String Select Case Multiplier Case "A" SetMultiplier = "[A]" Case "B" SetMultiplier = "[B]" Case "C" SetMultiplier = "[C]" Case Else 0 End Select End Function
I tried to change single & double quotation & many but failed.