Thanks for this. It works great.
I am using it to create a dynamic photo gallery so that up to 5 images can be displayed. maybe there's a better way but in my Recordset I have Photo1, Photo2 etc. On the page I bind these to each TD in the table to display them. How would I go about it so that if only 2 images have been uploaded the other 3 are not displayed? At the moment I have each as a placeholder on the page but do not want to show it if empty.