ACC: Type Mismatch When Comparing Bookmarks (152548)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q152548
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you compare a recordset's bookmark with a Variant or String variable,
you may receive the following error message:
Run-time error '13:'
Type Mismatch
This error message can also occur when you compare a recordset's bookmark
to the RecordsetClone of, for example, a form's record source.
RESOLUTION
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:
Dim RS As 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
REFERENCES
For more information about the StrComp() function, search the Help Index
for "StrComp Function," or ask the Microsoft Access 97 Office Assistant.
For more information about the Bookmark Property, search the Help Index
for "Bookmark Property," or ask the Microsoft Access 97 Office Assistant.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kberrmsg kbProgramming KB152548 |
---|
|