title: IF statement in Access Macros
body: <p>I'm trying to use the Macro utility in access to run an append query if the ID key in the Parent data table is larger than the ID key in the child table, named <code>Hoover Data</code> and <code>Hoover Match</code> respectively.</p>
  
  <p>My Macro has the following objects:</p>
  
  <pre><code>SetWarnings, No
     If Max([Hoover Data]![ID])&gt;Max([Hoovers Match]![ID])
        OpenQuery, 'Hoovers Match Update'
        CloseWindow, 'Hoovers Match Update'
  SetWarnings, Yes
  </code></pre>
  
  <p>My query, <code>Hoovers Match Update</code> runs fine and so does my Macro before I added the if statement -- that is to say that despite the shorthand writing of the above macro configuration is is correct.</p>
  
  <p>When I run the macro with the if statement I receive the following error:
     Access Cannot find the name <code>Hoover Data</code> you've entered in the expression</p>
  
  <p>I'm running Access 2013 (32bit) on a Win 7 (64 bit) Machine</p>