Did you try to add in the @ERROR+' '@SERROR code?

That will tell you why this does not WRITEVALUE.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's