Thanks for that.
I've tried running your code with the same data, however, this made me notice that your syntax for setting the value of @resultsHTML isn't valid, so I couldn't. Is this the part your speaking about? I'm also not sure what you mean by pass a variable to HTML? Are you trying to pass a value to a web server? Do you mean to create a hyperlink to something? For example, when you pass a parameter to a webpage, this is often done by adding it to the end of the web address. For example http://www.mywebsite.com/index.html?name=Thom_A passes a parameter name to the page, with the value Thom_A.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk