You should explore WriteLog() & WriteLog2() in the UDF library.

See this link: Kixtart.org UDF library collection

They will simplify you logging.
_________________________
Home page: http://www.kixhelp.com/hb/