title: How to delete all records from multiple tables with VBA loop? Access 2010
body: <p>I want a VBA loop function that will delete all records from any table with a name like "d2s_*".</p>
  
  <p>I've found code to delete all records:</p>
  
  <pre><code>DoCmd.SetWarnings False
  DoCmd.RunSQL "DELETE * FROM NameOfTable"
  DoCmd.SetWarnings True
  </code></pre>
  
  <p>I've also found a loop to call each table in the database:</p>
  
  <pre><code>Dim T As TableDef
  For Each T In CurrentDb.TableDefs
  Debug.Print T.Name
  Next T
  </code></pre>
  
  <p>So what I want to do is combine them:</p>
  
  <pre><code>Dim T As TableDef
  For Each T In CurrentDb.TableDefs
  DoCmd.SetWarnings False
  DoCmd.RunSQL "DELETE * FROM NameOfTable"
  DoCmd.SetWarnings True
  Next T
  </code></pre>
  
  <p>But as I understand, the SQL query has to reference a specific table name.  Is there a way to make this relative to any table starting with the name "d2s_"?</p>