• Convert FindIt recordset from DAO to ADO

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Convert FindIt recordset from DAO to ADO

    Author
    Topic
    #353037

    Convert FindIt recordset from DAO to ADO

    i want to convert from DAO to ADO the

    following code:

    Private Sub CboCompany_AfterUpdate()
    Dim rs As Recordset
    Set rs = Me.RecordsetClone
    rs.FindFirst “[ClientID] = ” &

    CboCompany.Value
    If rs.NoMatch Then
    MsgBox “Client Not Found”
    Else
    Me.Bookmark = rs.Bookmark

    End If
    End Sub
    Can somebody help me?

    Viewing 0 reply threads
    Author
    Replies
    • #515295

      Try this (make sure to add a reference to one of the Microsoft ActiveX Data Objects libraries; I used 2.1):

      Private Sub CboCompany_AfterUpdate()
      Dim rs As ADODB.Recordset
      Set rs = Me.RecordsetClone ‘I don’t know what this does
      rs.Find “[ClientID] = ” & CboCompany.Value, 0, adSearchForward
      If rs.EOF Then
      MsgBox “Client Not Found”
      Else
      Me.Bookmark = rs.Bookmark
      End If
      End Sub

      • #515445

        The recordsetclone makes a copy of the recordset collection the form uses. This allows one to search (for example) and move to an explicit record in the form or to warn that it has not been found. If you tried to do that with the records the form is based on directly it will become very comlicated.

        • #515486

          Keep in mind, though, that recordset clones in ADO are different from DAO recordsetclones and aren’t even created the same way. In ADO, they’re full independent instances of the recordset object, not just temporary copies of it, and any changes made to the recordsetclone are the real thing.

    Viewing 0 reply threads
    Reply To: Convert FindIt recordset from DAO to ADO

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: