The code in the second post worked, for anyone else needing it.

Thanks