Results 1 to 2 of 2

Thread: ADODC and DataList problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196

    Post

    Hello,

    I have an application that links to a database. On one particular form i have an ADODC object that liks via an ODBC DSN to one particular table in my database. I also have a Datalist object on the form.

    What I want to be able to do is when the user clicks on the datalist, whichever record they clicked on becomes the current record in the recordset of the ADODC control - just as if we had done "movenext" a couple of times.

    The code i tried is this:

    Private Sub DatList_Click()

    My_Adodc.Recordset.Bookmark = DatList.SelectedItem

    End Sub

    but when i run it i get this message:

    Runtime error: -2147217887 (80040e21)
    Method 'Bookmark' of object '_Recordset' failed


    Any help would be greatly appreciated.

    Thanks

  2. #2
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232

    Post

    seems to me you try to compare two different things: bookmarks and the selected item, that's why you get the error, try to use any .find / .findfirst method of the recordset to move to the selected record

Posting Permissions

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



Click Here to Expand Forum to Full Width