Ah, the lovely ‘gotchas’ of Multivalue Lists.
Long story short, you’re looking for the wrong ‘type’ of value. Use the code below, and read the explanation just beyond for more learning and extra credit.
Dim MyListVar As New ArrayList()
MyListVar = MultiValue.List("MyListParam")
For i=1 To 3
''' UNCOMMENT THE BELOW CODE TO SEE THE 'TYPE'
''' OF THE ACTUAL OBJECT STORED IN THE POSITION
''' (i-1) OF THE MyListVar PARAMETER!
''MessageBox.Show(TypeName(MyListVar(i-1)))
If MyListVar.Contains(CStr(i)) Then
MessageBox.Show("Success! Found the value """ & i & """ in the list!", "Success!",MessageBoxButtons.OK)
Else
MessageBox.Show("Failure! Value """ & i & """ not found in the list!", "Failure!",MessageBoxButtons.OK,MessageBoxIcon.Error)
End If
Next i
Alright, so what that iLogic function isn’t telling you is that the ArrayList is being built from the ExpressionList object that is attached to the MultiValue Property.
PICTURE TIME! :

----------------
An Expression is a string that can be interpreted as just a mathematical value or formula that shakes down to a value, and so in this case, the ExpressionList is just a collection of String Objects (or Variants according to the debug window).
What the ‘MultiValue.List(“Parameter”) does is take all of those Variant / String values, adds them to an ArrayList, and then sends that entire ArrayList back into whatever called it. In this case, it’s the MyListVar that you have declared.
When you ask it to check whether or not the value of “i” is inside of that ArrayList, it looks for an INTEGER value because ‘i’ was assigned a numeric value at the start of the For loop. Because the ArrayList contains only Strings, it wouldn’t be able to find any match and would return false.
Converting the value of ‘i’ into a String beforehand (as I have done in my code) clears up the issue! And now hopefully, this mystery should also be a bit more clear to you as well!
-----------
Question on my mind : Why would you like to search through the Multivalue list in this way? Are you worried about users inputting their own ‘non-standard’ values? Just curious
If my solution worked or helped you out, please don't forget to hit the kudos button 🙂iLogicCode Injector:
goo.gl/uTT1IB