Results 1 to 4 of 4

Thread: Looping Through Text File Question

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    400

    Looping Through Text File Question

    Hi All

    Just a question on capturing the data that i need from looping through a text file.
    I need to find a couple of records and then store them into an access db,
    so in my limited vb knowledge i have come up with this idea.
    VB Code:
    1. Dim N As Integer
    2. Do While Not rs.EOF
    3. For N = 0 To rs.Fields.Count - 1
    4.     If rs.Fields(N).Value = "^CASH" Then
    5.           Text2.Text = rs.Fields(N).Value '<<<< store in text box "CASH"
    6.           Text3.Text = rs.Fields(N + 3).Value ' <<< store in text box "$25.00
    7.           Exit For
    8.     End If
    9. Next N
    10. rs.MoveNext
    11. Loop
    to store the data, found from the loop into text boxes and then update the database from the data in the textbox.
    But i need to pick out about 40 records ie. "Credit Card", "Total Sales" etc and this would mean that i would need
    alot of invisible text boxes, so my question is, is this the best way to achieve this or is there a better way.

    Many thanks
    Last edited by Hack; Aug 25th, 2006 at 07:10 AM. Reason: Added [vbcode] [/vbcode] tags and indenting.

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