Yes you would need to cast to the desired type using the If operator, same as IIF function. This is because the true and false parts it could possibly return, are of type object, since it doesn't know what type the return value would be (and because types could vary based on the true/false evaluation).
So yes, cast your objects to whatever type you need them as.
Matt Kleinwaks - MSMVP MSDN Forums Moderator - www.zerosandtheone.com - visit my website for a chance to win an MSDN subscription.