title: Compile Error in VBA code in MS Access
body: <p>I have the following function in access, which was working fairly well. But now suddenly i am starting to get a compile error : Method or data member not found</p>
  
  <pre><code>Function Serialize(qryname As String, keyname As String, keyvalue) As Long
  Dim dbs As Database
  Dim rs As Recordset
  
  Set dbs = CurrentDb
  On Error GoTo Err_Serialize
  Set rs = dbs.OpenRecordset(qryname, dbOpenDynaset, dbReadOnly)
  
  
     On Error GoTo Err_Serialize
  
       'Find the current record.'
       Select Case rs.Fields(keyname).Type
          ' Find using numeric data type key value?'
          Case DB_INTEGER, DB_LONG, DB_CURRENCY, DB_SINGLE, _
          DB_DOUBLE, DB_BYTE
             rs.FindFirst "[" &amp; keyname &amp; "] = " &amp; keyvalue
          ' Find using date data type key value?'
          Case DB_DATE
             rs.FindFirst "[" &amp; keyname &amp; "] = #" &amp; keyvalue &amp; "#"
          ' Find using text data type key value?'
          Case DB_TEXT
             rs.FindFirst "[" &amp; keyname &amp; "] = '" &amp; keyvalue &amp; "'"
          Case Else
             MsgBox "ERROR: Invalid key field data type!"
  
       End Select
  
      Serialize = Nz(rs.AbsolutePosition, 0) + 1
  
  
  Err_Serialize:
          'Add your own Error handler'
          rs.Close
          dbs.Close
          Set rs = Nothing
          Set dbs = Nothing
  
  End Function
  </code></pre>
  
  <p>The error highlights <code>rs.Findfirst</code>.</p>
  
  <p>Is this a bug by any chance?</p>