Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch in ADODB - recordsetClone???

Status
Not open for further replies.

ldXbl

Technical User
Apr 22, 2004
9
US
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])"

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
 
The form use a DAO recordset, not an ADODB one.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top