If you read my post, you'd have seen I was short on time last night. I was reporting that Radimus' change was returning an error even when it worked. I broke the code down line by line to determine that the statements within the IIf were working properly - hence the If/Else/Endif.

Also - it was Radimus' change - I restored his original code just to show it worked before. The problem appears to be in the IIf, since breaking it out to an If/Else/Endif works... I have since updated the code to use the join statement and it STILL works as long as the IIf isn't used.

Even though the IIf is returning the correct data, when you check the exit code, it is failing - the individual statements within the code are working just fine.

At this point, based on this and the challenges that NTDoc and I had the other night, it appears that IIF does not work exactly like an If/Else/Endif statement.. If you test and return values, it is fine, but if you test and return results of other statements that might be invalid WHEN they should not be executed (the purpose of the IF) you get an error, or the IIF returns strange data. I'm not sure if we're pushing the design limits of IIF, but I won't use it moving forward to return statement results. I've been "burned" a number of times.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D