title: Setting Auto Increment Start Value as a Variable in Access
body: <p>I've looked around online but can't find any clear answers for this. Is it possible to set the starting value of an Auto Increment field to a variable (example to follow) in MS Access VBA?</p>
  
  <pre><code>Private Sub Command10_Click()
  Dim dbs As Database
  Set dbs = CurrentDb
  Dim tblTempMinID As String
  
  tblTempMinID = "DMax(EntryID, tblCalendar) + 1"
  dbs.Execute "ALTER TABLE tblTemp ALTER COLUMN EntryID AUTOINCREMENT(tblTempMinID)"
  
  End Sub
  </code></pre>
  
  <p>I'm currently getting an error in field definition with the above code. Still doing research, but I figured it wouldn't hurt to put this out here.</p>