Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Populate a Datasheet Form using ADO


Message #1 by "david brown" <david.brown@m...> on Fri, 21 Feb 2003 11:43:51
How do I populate a datasheet form using ADO:

I have the following code, which gets and enumerates the values OK, but 
the datasheet resulting from it only has one record with the value of the 
last record resulting from the ADO.

I can see what it is doing, but how do I get the datasheet to move to the 
next record in sync with the movement through ADO?

I was using pass through queries to do this, but my book says these are 
obsolete as a result of ADO, but does go on to say how you do it!!

Here is my code

    With rst
        .Open Source:="scheme.slcustm", _
        ActiveConnection:=cnnSAGE, _
        CursorType:=adOpenKeyset, _
        LockType:=adLockOptimistic
        Do While Not .EOF
            'Debug.Print .Fields("customer")
            Me.txtcustomer = .Fields("customer")
            .MoveNext
        Loop
        .Close
    End With
   

  Return to Index