title: Using a query within a form - Microsoft access
body: <p>Hi I have a form that has a text box in the header and when the user enters the farmer Code into the text box the relevant record is displayed. </p>
  
  <p>I am using the following criteria in the query within my Form Cotton12:</p>
  
  <p>Like <code>[Forms]![Cotton12].[2012]</code></p>
  
  <p>Now I have 2 tables Table Cotton12 and Table Cotton11. They contain a database of farmers, from the year 2012 and 2011. Sometimes the data is the same sometimes it is not. For example Farmers are given farmer codes, however due to incorrect capturing of data different farmers have been given different codes throught over the years.</p>
  
  <p>What I would like to do is in the same form, have the user enter in a farmer code and data from the 2012 table come up and the data from 2011 table come up so they can be compared and if that code is not in one of the tables the fields relating to that table stay blank.</p>
  
  <p>For E.g. the form might look like this.</p>
  
  <pre><code>2012
  Farmer Name
  Acreage
  Yield Estimate
  2011
  Farmer Name
  Acreage
  Yield Estimate
  </code></pre>
  
  <p>Your help would be much appreciated.</p>