Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting and numbering records

Status
Not open for further replies.

jbradley

Programmer
Sep 7, 2001
248
US
I'm importing check data into an Access table from an ASCII text file. Once all the records are imported I am sorting them by Federal Reserve banking district and assigning sequential print sequence numbers like so:
Code:
With rs
    .Open "SELECT FedDistrict, PrintSequence " & _
          "From Checks " & _
          "Where PrintBatch = " & intBatch & " " & _
          "ORDER BY FedDistrict", cn, adOpenForwardOnly, adLockOptimistic
    Do While Not .EOF
        !PrintSequence = lngPrintSequence
        lngPrintSequence = lngPrintSequence + 1
        .MoveNext
    Loop
    .Close
End With
I have another field into which I need to insert a repeating sequence of numbers from 1 to 250, restarting the sequence on each change of Fed district. Can anyone point me in the right direction on this?
 
I would import the data into a VB UDT array. This would allow you to sort it any way you want or need and make any changes or additions to the data. Once complete then export the data into your Access Database. Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top