Yeah, it's a "flaw" of sorts in the VB6 implementation of the IIF() function.... the fact that it is a function means that all three of the parameters get evaluated... you'll need to use a full If statement as dilettante has suggested. PITA I know, but it is what it is.

-tg
side note - in .NET this has been fixed with the If() ternary function... which evaluates the condition FIRST... then and only then determines which of the other two expressions to then evaluate.