Lonks last code was my first take at it, but I didn't post that. I added the if $sErr<0 to make it error proof. Adding IIF is less compatable with earlier versions of KiX.