title: Bind field to temporary recordset field programmatically
body: <p>I'm trying to display a recordset that is created programmatically. But I'm having problems binding the controlsource to the recordset fields.</p>
  
  <p>The following code outputs "#Error" in the FirstField textbox.</p>
  
  <pre><code>Option Compare Database
  Option Explicit
  
  Private Sub Form_Load()
      Dim rs As ADODB.Recordset
      Set rs = New ADODB.Recordset
  
      With rs.Fields
          .Append "A", adInteger
          .Append "B", adInteger
          .Append "C", adInteger
      End With
  
      rs.Open
  
      With rs
        .AddNew
          ![a] = 1
          ![b] = 1
          ![c] = 1
        .Update
      End With
  
      rs.Clone
  
      Set Me.Recordset = rs
      Me.FirstField.ControlSource = rs.Fields(0).Name 'outputs #Error in FirstField
  End Sub
  </code></pre>
  
  <p>Help is much appreciated!</p>
  
  <hr>
  
  <h2>What I'm trying to do</h2>
  
  <p>I have a database which represent used parking spaces in a parking lot. A,B,C are position coordinates each of these have a validation rule set so they cannot exceed their limits. Now I want to display all available parking spaces.
  So I figured I'd create a "fake" database with all parking spaces and then do a query-thing where I only display entires from the fake database where the position is not in the "used parking space" database.</p>
  
  <p>Creating a database with only the positions seemed silly to me and populating the "used parking space" database with all parking spaces and then adding a used boolean field also seemed like a bad idea.</p>
  
  <p>I welcome input on how I could solve this in a better way.</p>
  
  <p><em>Thank you for you time.</em></p>