title: Where function on a virtual column in a union query
body: <p>I am new to sql and I need a little help. I have got a <code>union</code> query with 3 tables. I have got a virtual column so I can tell which table each row is from. I would like to be able to filter this virtual column to show only rows from a specific table.</p>
  
  <p>I am using Microsoft Access and this is what I have so far:</p>
  
  <pre><code>SELECT Table1 as Table_Name, Table1.1  
  FROM Table1  
  UNION ALL  
  SELECT Table2 as Table_Name, Table2.1  
  FROM Table2  
  UNION ALL  
  SELECT Table3 as Table_Name, Table3.1  
  FROM Table3  
  UNION ALL  
  WHERE Table_Name = Form1.TextBox  
  ORDER BY Table1.1;
  </code></pre>
  
  <p>I am trying to link this to a listbox on a form and then have some textboxs to filter results.</p>