title: In Memory, Stand-Alone, Disconnected ADO Recordset
body: <p>I'm running this code on my datasheet subform when my form loads and I'm not getting any error messages or code breaks. My debug.print shows that the Recordset rs is filled with 2131 records like it should be, but my form shows a single row with #Name? in every field. The control source properties on my controls most certainly do match the field names I have listed above. RS is a form level variable and I'm not closing it or setting it to nothing until the form closes.</p>
  
  <p>Any idea what am I doing wrong?</p>
  
  <pre><code>Set rs = New ADODB.Recordset
  rs.Fields.Append "TimesUsed", adInteger
  rs.Fields.Append "strWorkType", adVarWChar, 150
  rs.Fields.Append "DateLastUsed", adDate
  rs.Fields.Append "SelectedYN", adBoolean
  Set rs.ActiveConnection = Nothing
  rs.CursorLocation = adUseClient
  rs.LockType = adLockBatchOptimistic
  rs.Open
  
  Dim sSQL As String
  sSQL = "MyComplicated SQL Statement Ommitted from this SO Question"
  
  Dim r As DAO.Recordset
  Set r = CurrentDb.OpenRecordset(sSQL, dbOpenDynaset, dbSeeChanges)
  If Not (r.EOF And r.BOF) Then
      r.MoveFirst
      Dim fld
      Do Until r.EOF = True
          rs.AddNew
          For Each fld In r.Fields
              rs(fld.Name) = r(fld.Name).value
          Next
          rs.Update
          r.MoveNext
      Loop
  End If
  r.Close
  Set r = Nothing
  Debug.Print rs.RecordCount '2131 records
  Set Me.Recordset = rs
  </code></pre>
  
  <p>OK, so I just read <a href="http://msdn.microsoft.com/en-us/library/bb243828%28v=office.12%29.aspx" rel="nofollow">this on the MSDN site</a>:</p>
  
  <p><em>The recordset must contain one or more fields that are uniquely indexed, such as a table's primary key.</em></p>
  
  <p>(Note: This information seems to be erroneous in this context.)</p>