Results 1 to 13 of 13

Thread: [RESOLVED] Trouble opening files

Threaded View

  1. #1

    Thread Starter
    Addicted Member seditives's Avatar
    Join Date
    Jan 2011
    Location
    South of England
    Posts
    151

    Resolved [RESOLVED] Trouble opening files

    The code bellow basically opens each customer .txt file (each having a 0 to 10 array) I want to extract two entities from each array (depending if array number "9" = yes) but when I run the de-bug comes up on the part of the code which opens the file, the file being opened with the .path and .filename so where am I going wrong??


    On Form Load:
    Code:
    Dim CusData(0 To 10) As String
    Dim i As Integer
    Dim Customer As Integer
    
    
    Private Sub Form_Load()
    File1.Path = (App.Path & "\SAVED_DATA\CustomerPI")
    i = 0
    Customer = File1.ListIndex
    Customer = 0
    
    For Customer = 0 To File1.ListCount - 1
    
       Open (File1.Path & "\" & File1.FileName) For Input As #1
       Do While Not EOF(1)
       Input #1, CusData(i)
    i = i + 1
       Loop
    
        If CusData(9) = "yes" Then
        lblM1.Caption = CusData(7)
        lblM2.Caption = CusData(10)
        End If
    
       Close #1
    
    Next Customer
    
    End Sub
    Last edited by seditives; Jul 2nd, 2011 at 11:06 AM.
    A subtle thought that is in error may yet give rise to fruitful inquiry that can establish truths of great value. - Isaac Asimov

Tags for this Thread

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