title: Why am I seeing Runtime error 3421 - access vba?
body: <p>I have been using a vba code to make my work life easier but for some reason it stopped working as supposed to. What it does it gets a number from my DB and goes to website to find relevant certificate assigned to this number (company), then it reads the grade and expiry date which are to be recorded in same DB. The issue is now when it goes to</p>
  <p><strong>rs.fields(&quot;Expiry&quot;).Value = Split(sResult, &quot;|&quot;)(1)</strong></p>
  <p>it throws a Runtime error 3421 which i believe is due to column being formatted as for date data type but it worked correctly for several months..? It work when changed data type to text however that will mess it up as later I use it in queries and reports and need it as a date.</p>
  <p>Any ideas why it changed and how to fix it please?
  Thanks
  MD</p>
  <pre><code>Sub Get_BRCDirectory_Data()
  Dim sCode, rs As DAO.Recordset, dic As Object, sResult As String, i As Long
  
  Set dic = CreateObject(&quot;Scripting.Dictionary&quot;)
  dic.CompareMode = 1
  
  Set rs = CurrentDb.OpenRecordset(&quot;Approved&quot;)
  If Not (rs.BOF And rs.EOF) Then
      rs.MoveFirst
  
      Do
          sCode = rs.fields(&quot;SupplierCode&quot;).Value
          
          If sCode &lt;&gt; &quot;&quot; Then
              If Not dic.Exists(sCode) Then
                  sResult = GetGradeExpiryDate(CStr(sCode))
      
                  rs.Edit
                  rs.fields(&quot;Grade&quot;).Value = Trim(Split(sResult, &quot;|&quot;)(0))
                  rs.fields(&quot;Expiry&quot;).Value = Split(sResult, &quot;|&quot;)(1)
                  rs.UPDATE
                  dic(sCode) = Array(rs.fields(&quot;Grade&quot;).Value, rs.fields(&quot;Expiry&quot;).Value)
              Else
                  rs.Edit
                  rs.fields(&quot;Grade&quot;).Value = dic(sCode)(0)
                  rs.fields(&quot;Expiry&quot;).Value = dic(sCode)(1)
                  rs.UPDATE
              End If
          End If
  
          rs.MoveNext
      Loop Until rs.EOF
  End If
  
  MsgBox &quot;Done&quot;, 64
  </code></pre>