Sorry, what you are doing is beyond me. I will say that I do not know
of any commercial product that does this.
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
You could look at CodeSmith or other code generation products. I think they
all probably build classes based on tables, and you could see if any also
support queries.