Run-Time Error 13 Type Mismatch

R

Ray Todd Jr

This function causes a Run-Time Error 13, Type Mismatch Error on this line:

set rstclone=frm.recordsetclone

What have i done incorrectly to cause this error?

Thanks,

Ray.


Public Function DisableEnable(frm As Form)
Dim rstClone As Recordset

Set rstClone = frm.RecordsetClone

If frm.NewRecord Then
frm!cmdFirst.Enabled = True
frm!cmdNext.Enabled = False
frm!cmdPrevious.Enabled = True
frm!cmdLast.Enabled = True
frm!cmdNew.Enabled = False
Exit Function
End If

frm!cmdNew.Enabled = True

If rstClone.RecordCount = 0 Then
frm!cmdFirst.Enabled = False
frm!cmdNext.Enabled = False
frm!cmdPrevious.Enabled = False
frm!cmdLast.Enabled = False
Else
rstClone.Bookmark = frm.Bookmark
rstClone.MovePrevious
If rstClone.BOF Then
frm!cmdFirst.Enabled = False
frm!cmdPrevious.Enabled = False
Else
frm!cmdFirst.Enabled = True
frm!cmdPrevious.Enabled = True
End If
rstClone.Bookmark = frm.Bookmark

rstClone.MoveNext
If rstClone.EOF Then
frm!cmdNext.Enabled = False
frm!cmdLast.Enabled = False
Else
frm!cmdNext.Enabled = True
frm!cmdLast.Enabled = True
End If
End If
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top