Update fields in previous row from fields in current row



Hello.

Developing a VB6, SP6 program using ADO.

If i cycle through a recordset and want to update a previous row with fields
from the current row, how would i do that? I have the basic logic as you
can see below, i just don't know how to refer to a recordset row that has
already been read.

casInputFileRecordset.Open
casInputFileRecordset.MoveFirst
Do Until casInputFileRecordset.EOF
If casInputFileRecordset.Fields("CASNumber").Value <> "" Then
(previous row) casInputFileRecordset.Fields("CASNumber").Value =
(current row) casInputFileRecordset.Fields("CASNumber").Value

End If
casInputFileRecordset.MoveNext
Loop

Any help would be gratefully appreciated.

Thanks,
Tony


.



Relevant Pages

  • Re: OpenRecordset not working
    ... I figured out how to use the filter property so I got my Function to ... "LeAnn" wrote: ... In the recordset I have a CycleNumber field (not unique ... > There is also a field called CycleSeconds which calculates the cycle time. ...
    (microsoft.public.access.modulesdaovba)
  • Re: find out if a recordset contians a field
    ... Without trapping an error, which would be the quickest and shortest method, you'd have to cycle through the fields collection of the recordset looking for the name of the field. ...
    (microsoft.public.access.modulesdaovba)
  • Re: OpenRecordset not working
    ... a second struggle. ... In the recordset I have a CycleNumber field (not unique ... There is also a field called CycleSeconds which calculates the cycle time. ... For lngPrevSeconds I do get cycle 1 CycleSeconds but for lngPrev2Seconds I ...
    (microsoft.public.access.modulesdaovba)
  • Re: Back to the loop that doesnt loop
    ... Private Sub Command4_Click ... Dim rs As DAO.Recordset ... The recordset is what I expect. ... then on the second cycle back from 0 to -1. ...
    (microsoft.public.access.gettingstarted)
  • Re: Programmatically accesing query results
    ... I wish to run a query and then cycle through the results and write ... just one field into a text file in cvs format ... is selected in a combo box by the user a query seems the easiest way. ... QUESTION How do i access the query results much like a recordset so ...
    (microsoft.public.access.modulesdaovba)