I'm guessing that you've got references set to both DAO and ADO.
The problem is that both the DAO and ADO models have a Recordset object in
them, but they're not interchangable. Access will pick whichever Recordset
object it comes to first and use that, regardless whether it's the correct
one. You can disambiguate to get around this by using either
Dim RS As DAO.Recordset
or
Dim RS As ADODB.Recordset
Now, I hate to say it, but I can never remember whether Me.Recordset.Clone
results in an ADO or a DAO recordset. (I _think_ Me.Recordset.Clone results
in an ADO recordset, while Me.RecordsetClone, without the period between
Recordset and Clone, results in a DAO recordset.) Because I can't remember,
I'm going to suggest cheating, and using
Dim RS As Object
instead.
(either that, or play with the two others to see whether one works)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Wylie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm trying to shift focus out of a continuous subform back to a control
> on the mainform when the user tabs off the last record. However, I'm
> get type mismatch error on "If Me.Bookmark = RS.Bookmark Then" that I
> can't figure out. Both parent and child forms are bound to Sql Server
> tables linked into to Access.
>
> (on control in subform)
> Private Sub Field_Value_KeyPress(KeyAscii As Integer)
> If KeyAscii = 9 Or KeyAscii = 13 Then
> Dim RS As Recordset
> Set RS = Me.Recordset.Clone
> RS.MoveLast
> If Me.Bookmark = RS.Bookmark Then
> Forms!Devices!Device_Notes.SetFocus
> End If
> End If
> End Sub
>
>
> thanks,
>
> wylie
>