I can not figure why i keep getting a type miss match on line 3 Set rstClone = frm.RecordsetClone isn't frm.RecordsetClone a match with ADODB.Recordset?? Thanks for any help....
this is how im calling the modual ..from the on current event with "=DisableEnable([Form])"
this is how im calling the modual ..from the on current event with "=DisableEnable([Form])"
Code:
Public Function DisableEnable(frm As Form)
Dim rstClone As ADODB.Recordset
Set rstClone = frm.RecordsetClone
If frm.NewRecord Then
frm!cmdFirst.Enabled = True
frm!cmdPrevious.Enabled = True
frm!cmdNext.Enabled = False
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