Results 1 to 5 of 5

Thread: [Resolved] recordset does not support bookmarks

  1. #1

    Thread Starter
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828

    Question [Resolved] recordset does not support bookmarks

    What types of recordsets DO support bookmarks then.

    I've used them before, (bookmarks i mean) but i didn't set anything specific....
    Last edited by darre1; Jan 31st, 2002 at 04:56 AM.
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  2. #2

  3. #3

    Thread Starter
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    this is my code:

    Code:
    Private Sub SortOutstandingList(strByField As String, strOrder As String)
    'Redisplays the listbox
    On Error GoTo ErrorHandler
    
        Dim rst As Recordset
        
        'Define the recordset
        If rstOutstanding.State = adStateOpen Then rstOutstanding.Close
        rstOutstanding.Open "SELECT * FROM qrylbxLogsOutstanding " _
            & "ORDER BY " & strByField & " " & strOrder & ", numPriority ASC;", db, _
            adOpenDynamic, adLockPessimistic
    
        'Clone the recordset to prevent the MoveComplete event from firing
        ***NEXT LINES GENERATES THE ERROR***
        Set rst = rstOutstanding.Clone
        
        'Clear then Populate list
        lbxOutstanding.Clear
        While Not rst.EOF
            lbxOutstanding.AddItem rst!ListString
            lbxOutstanding.ItemData(IIf(lbxOutstanding.NewIndex = -1, 0, lbxOutstanding.NewIndex)) = CInt(rst!ID)
            rst.MoveNext
        Wend
        rst.Close
        
        'Display first record in list
        If lbxOutstanding.ListCount >= 1 Then
            lbxOutstanding.ListIndex = 0
        End If
        
    CleanUp:
        Set rst = Nothing
        Exit Sub
        
    ErrorHandler:
        MsgBox Err.Description, , Err.Number
        Resume CleanUp
    End Sub
    I know that to clone a recordset it has to support bookmarks, but i've got my recordset with dynamic access anyway! Other recordsets work fine, just this one.

    Is it because im accessing a stored query?
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  4. #4

  5. #5

    Thread Starter
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    the original is used to populate a listbox with a few fields form each record.

    I then have code in the listbox's on_Click event to navigate the recordset to the record that was just clicked in the list.

    I then have code in the recordset's on_move event that fills the textboxes etc on screen, to display the values of the current record.

    NOTE: This method of record selecting is bloody fast.

    I also have sort buttons for the listboxes, which is where the code that i pasted comes in.

    The problem is, that if i dont use a clone recordset then the On_Move event will fire each time i add a record to the listbox (think about it)

    At the moment i'm just declaring 2 recordsets which are identical, but in all my other forms etc and other apps i can create clones and get round the OnMove event problem easily...
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

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