title: VBA Excel-Access 3251 Runtime error
body: <p>I currently use Microsoft Office 2007 and have linked an Access 2007 Database to Excel 2007 Database.  So far so good.  I can update the Access Database and it shows automatically in the Excel file.  Here is where I have the problem.</p>
  
  <p>When I try to update an Access Database from within Excel; I keep getting the runtime 3251 Error. =>runtime error now resolved but NEW issue regarding a NULL value when im trying to add data?</p>
  
  <pre><code>Sub ADODBExcelToAccess()
  'Collecting data from the
      Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
  
      '---NOTE: Sheet is set to auto refresh data from the database on loading---
  
      ' connect to the Access database
      Set cn = New ADODB.Connection
      cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; " &amp; _
              "Data Source=" &amp; Application.ActiveWorkbook.Path &amp; "\linktest.accdb;"
  
      ' open a recordset (i.e. a table)
      Set rs = New ADODB.Recordset
  
      rs.Open "linktest", cn, adOpenKeyset, adLockOptimistic, adCmdTable
  
      ' all records in a table
      For i = 4 To 16
          x = 0
  
          Do While Len(Range("K" &amp; i).Offset(0, x).Formula) &gt; 0
              With rs
                  'create a new record
                  .AddNew
                  .Fields("ID") = Range("A1" &amp; i).Value
                  .Fields("PriceID") = Range("B1").Value
                  .Fields("ProductCode") = Range("C1").Value
                  .Fields("Price") = Range("D1" &amp; i).Value
                  .Fields("CurrencyType") = Range("E1").Value
                  .Fields("Type") = Range("F1").Value
                  .Fields("Production") = Range("G1" &amp; i).Value
                  .Fields("Quantity") = Range("H1" &amp; i).Value
                  .Fields("Details") = Range("I1" &amp; i).Value
                  .Fields("DateUpdated") = Range("J1" &amp; i).Value
                  .Fields("Setup") = Range("K1" &amp; i).Value
  
                  ' stores the new record
                  .Update
  
              End With
              x = x + 1
          Loop
      Next i
      rs.Close
      Set rs = Nothing
      cn.Close
      Set cn = Nothing
  End Sub
  </code></pre>
  
  <p>The current reference library that I'm using is Active X Data Objects 2.1 Library.</p>