Yeah, with a few tweaks, that works really nice!! I had to param one of the form elements that was checkboxes, because it didn't like a null value, but that was a small change.
Thanks Reed, it's way better now, and I would have never thought to try that because I totally forgot that a query that returns zero records still returns the column names.
Always learning something new!