Do you have a specification name for every possible permutation of your data? If you do, is it strictly on the number of columns produced by the crosstab query? If it is you could do something like this:
Code:
if rst2.fields.count = 10 then
'set your export specification to item x
elseif rst2.fields.count = 11 then
'set your export specification to item y
elseif
'and so on
endif
I seem to have a memory of crosstabs being very temperamental when you perform an export what I typically do is create a temporary access table then export that table, particularly if you are exporting a crosstab with *ANY* criteria at all. If your crosstab has criteria you may have to create the SQL statement in your code to get it to run without generating an Access table first.