ACC2000: "Type Mismatch" Error When Comparing BookmarksID: Q198648 
  | 
Moderate: Requires basic macro, coding, and interoperability skills.
When you compare a recordset's bookmark with a Variant or String variable, you may receive the following error message:
This error message can also occur when you compare a recordset's bookmark to the RecordsetClone of, for example, a form's record source.Run-time error '13:'
Type Mismatch
Use the StrComp() function to compare a Variant or String variable to a bookmark, or to compare a bookmark against a bookmark. The third argument for the StrComp() function must be set to a value of 0 (zero).
For example, the following code tests to see if a form is displaying its
last record by first cloning the record source of the form, moving to the
last record within the cloned recordset, and then testing to see if the
last record within the cloned recordset matches the record currently
displayed on the form:
The sample code in this article uses Microsoft Data Access
Objects. For this code to run properly, you need to reference
the Microsoft DAO 3.6 Object Library.
Dim RS As DAO.Recordset
Set RS = Me.RecordsetClone
RS.MoveLast
If StrComp(Me.Bookmark, RS.Bookmark, 0) = 0 Then
   MsgBox "Form is displaying the last record."
End If 
Dim RS As Recordset
Set RS = Me.RecordsetClone
RS.MoveLast
If Me.Bookmark = RS.Bookmark Then
   MsgBox "Form is displaying the last record."
End If Run-time error '13:'
Type mismatch
If Me.Bookmark = RS.Bookmark Then For more information about StrComp Function, in the Visual Basic Editor, click 
Microsoft Visual Basic Help on the Help menu, type "StrComp Function" in 
the Office Assistant or the Answer Wizard, and then click Search to 
view the topic.
For more information about Bookmark Property, in the Visual Basic Editor, click 
Microsoft Visual Basic Help on the Help menu, type "Bookmark Property" in 
the Office Assistant or the Answer Wizard, and then click Search to 
view the topic.
Additional query words:
Keywords          : kberrmsg kbprg PgmObj 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 
Last Reviewed: July 15, 1999