title: How can I delete a field from a table in Access VBA
body: <p>I have a function that I am making to delete a specified field from a table that I have created in MS Access. have used <a href="https://stackoverflow.com/questions/19266532/cant-add-new-field-after-deleting-fields">this</a> question for reference.  How could I make this delete a specified field?  Here is what I have so far:</p>
  
  <pre><code>Private Function removeFieldsFromIIPM(tableName As String, fieldToDrop As String)
  
      Dim dbs As Database
      Dim field As field
  
      Set dbs = CurrentDb()
      Set field = dbs.TableDefs([tableName]).Fields(fieldToDrop)
      dbs.TableDefs([tableName]).Fields.Delete field.Name
      dbs.Close
      TableDefs.Refresh
  
  End Function
  </code></pre>