title: recordset.find using variable VBA ADODB
body: <p>I am getting pretty desperate trying to get this trivial search to work:</p>
  
  <pre><code> rst2.Find "ID = '" &amp; messID &amp; "'"
  </code></pre>
  
  <p>I have tried just about any combination but it just never returns a search result. the whole code would be here:</p>
  
  <pre><code>Option Compare Database
  Option Explicit
  
  'Modul zum Updaten des Status eines Messmittels in der Stammdatenbank (Entnommen/Verfügbar)3
  
  Public Function updateStatus()
  
  Dim rst2 As ADODB.Recordset
  Dim rst As ADODB.Recordset
  Dim messID As String
  
  Set rst = New ADODB.Recordset 'Stammdaten zur Bearbeitung öffnen
              rst.ActiveConnection = CurrentProject.AccessConnection
              rst.CursorType = adOpenKeyset
              rst.LockType = adLockOptimistic
              rst.Open "Stammdaten"
              rst.MoveFirst
  
  Set rst2 = New ADODB.Recordset 'zur Bearbeitung öffnen
              rst2.ActiveConnection = CurrentProject.AccessConnection
              rst2.CursorType = adOpenKeyset
              rst2.LockType = adLockOptimistic
              rst2.Open "Verwendung"
  
  Do While Not rst.EOF
              messID = rst!ID
              Debug.Print messID
              rst2.Find "ID = '" &amp; messID &amp; "'"
              If rst2.EOF = True Then 'Falls nicht vorhanden
                  Debug.Print "Keine Verwendung gefunden!"
              Else
                  rst2.Sort = "Nr DESC"
                  rst2.MoveFirst
                  Debug.Print rst2!Status
              End If
              rst.MoveNext
  Loop
  rst.Close
  rst2.Close
  
  End Function
  </code></pre>
  
  <p>What am I missing? I literally tried hunderds of diffrent search strings :(</p>