title: Insert textbox value into Access SQL query
body: <p>Being an amateur in Access and VBA, I've hit a wall with the following...</p>
  
  <p>In MS Access 2007, I have the following query:</p>
  
  <pre><code>SELECT .... WHERE format(NZ(l_f_date),'yyyy-mm-dd')&lt;=**'2012-04-03'**);
  </code></pre>
  
  <p>I have shortened it a bit of course.</p>
  
  <p>The database has approx 20 queries that need to be run on a daily basis.  I have created 4 macros to run groups of queries in the manner that I need them to be run. The problem is that in every one of those queries I first have to change the date (like in the upper query). I am looking for the way to automate it a bit more.</p>
  
  <p>I have an idea to create a Form, place a button for every macro on it and 2 textbox-es to enter the 2 dates I need. Now, I need those dates to appear in the bolded part. As I think about it, I have 2 options:</p>
  
  <ul>
  <li>Create a temporary table in the database to store those two dates and pull those 2 fields in my queries.</li>
  <li>Insert the value of the textbox somehow directly into the bolded part of the query.</li>
  </ul>
  
  <p>I think I can manage the first solution, but the second one is making my head hurt.</p>
  
  <p>Can you help?</p>
  
  <hr>
  
  <p>SQL from comment</p>
  
  <pre><code>select proc_desc,count(s) as broj 
  into upit3 
  from ( select distinct a.case_id as s,
            a.org_case_id,a.act_date as day,d.prod_id,d.prod_desc,
            c.fname,c.dpd,c.due_amount,proc_id,proc_desc 
         from actions_b as a, cases_old_b as c,processes_b as p,
              product_dict_b as d 
         where a.org_case_id=c.[org_ case_id] 
         and a.act_date=Forms!Form!Text10 and d.prod_id=c.product 
         and p.proc_id=c.process and not_lead=1 ) 
  group by proc_desc order by proc_desc;
  </code></pre>
  
  <p>OK, sample data....</p>
  
  <p>In x.dates, value is exactly like this: <strong>03.04.2012</strong><br>
  In a.act_date value is like this: <strong>01.07.2011 13:53:56</strong></p>
  
  <p>so if its not possible with this values as they are, is it possible to use a LIKE statement in the query? Pseudo:  <code>WHERE a.act_date LIKE x.date%</code><br>
  If its possible, how to use it? i am a novice in sql and access queries... I google but sometimes, like this time, i get stuck.<br>
  Thanks</p>