title: sql Query in VBA code
body: <p>If I want to code the following in VBA how do I do it</p>
  
  <pre><code>QUERY1:
  SELECT field1, Min(field4) AS MinField4, Max(field5) AS MaxField5
  FROM Table1
  GROUP BY field1;
  
  
  SELECT Query1.field1, Table1.field2, Table1.field3, Query1.MinField4,
         Query1.MaxField5
  FROM   Query1 INNER JOIN Table1 ON (Query1.field1 = Table1.field1) AND
         (Query1.MinField4 = Table1.field4) AND
         (Query1.MaxField5 = Table1.field5);
  </code></pre>
  
  <p>I know for executing the SQL I store it as as string and write run SQL.
  but how do I code storing query1 as a persistent object that can be referenced in other SQL statements?</p>