But.. If memory serves, you can simplify this quite a bit by using a Policy..

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