Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Convert FindIt recordset from DAO to ADO

    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?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Convert FindIt recordset from DAO to ADO

    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

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Convert FindIt recordset from DAO to ADO

    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.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Convert FindIt recordset from DAO to ADO

    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.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •