title: 3265: item not found in this collection
body: <p>In an <code>MS Access</code> table, I have some attachments to each item.</p>
  
  <p>I would like to save each attachment in a temporary directory through a <code>VBA</code> code.</p>
  
  <p>The VBA code that I am trying to replicate is in this tutorial
  <a href="https://www.youtube.com/watch?v=Gm5fch0xaI4&amp;t=306s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Gm5fch0xaI4&amp;t=306s</a></p>
  
  <p>The problem is that I get the <code>error '3265' item not found in this collection</code> already when I am trying to assign a value to a <code>DAO.Recordset2</code> object.</p>
  
  <p>Here my code.</p>
  
  <p><a href="https://i.stack.imgur.com/DI6Bo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DI6Bo.jpg" alt="enter image description here"></a></p>
  
  <pre><code>Private Sub Carica_Dati()
  
  Dim rsParent As DAO.Recordset
  Dim rsAttachment As DAO.Recordset2
  Dim SQL As String
  
  SQL = " SELECT [Data Processing List].Department" &amp; _
        " FROM [Data Processing List]" &amp; _
        " WHERE ((([Data Processing List].Treatment)=""HR-002""))"
  
  Set rsParent = CurrentDb.OpenRecordset(SQL, dbOpenSnapshot)
  
  If rsParent.RecordCount = 0 Then
      MsgBox "no"
  Else
      Set rsAttachment = rsParent!Document.Value
  End If
  
  End Sub
  </code></pre>