Results 1 to 5 of 5

Thread: opening files Arrg

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    I Still cannot get this to work can anyone please tell me where the problem is and what i am doing wrong . a file number is entered
    in a text box automaticaly the file exits but i am gettig a error 75 Please help am new to VB
    Private Sub Open_File()
    Dim intFreeFile As Integer
    Dim strFileName as String
    strFileName = txtFileName.Text
    strFileName = Dir("d:\Home.txt")

    intFreeFile = FreeFile

    Open strFileName For Input As #intFreeFile
    Do

    Line Input #intFreeFile, strMember
    Line Input #intFreeFile, strname
    Line Input #intFreeFile, strlastname
    Line Input #intFreeFile, straddress
    Line Input #intFreeFile, strphone

    Loop Until EOF(intFreeFile)
    Close #intFreeFile

    End Sub
    i Know that i could set up a control array and it would be easier but i want to get this way to work first The runtime error is 75
    i Know it is something really stupid that i have overlooked or forgot to do

  2. #2
    Member
    Join Date
    Nov 1999
    Posts
    32

    Post

    Private Sub Open_File()

    Dim intFreeFile As Integer
    Dim strFileName As String

    '''''''strFileName = txtFileName.Text
    strFileName = Dir("d:\Home.txt")
    intFreeFile = FreeFile

    Open strFileName For Input As #intFreeFile

    Do

    '''''''Line Input #intFreeFile, strMember
    '''''''Line Input #intFreeFile, strname
    '''''''Line Input #intFreeFile, strlastname
    '''''''Line Input #intFreeFile, straddress
    '''''''Line Input #intFreeFile, strphone

    Input #intFreeFile, strMember, strname, strlastname, straddress, strphone

    Loop Until EOF(intFreeFile)
    Close #intFreeFile

    If you use line input#, it is to read entire records into a single variable. it also read an entire commas, quotation marks, exclamation marks, hyphens, everything else!

    If you use #input, it is to read data into a list of variables...


    ROSE

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    thxs rose But why am i getting a filepath error when i run the program eg 75

  4. #4
    Member
    Join Date
    Nov 1999
    Posts
    32

    Post

    75?

    I have no idea...

    Perhaps, it could not find the directory path.

    Let me see your code...? I can help you in any ways.

  5. #5
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Post


    Hi Jessie,

    The file isn't there
    D:\Home.Txt

    Try to create Home.Txt (empty also never mind), there should not be any error 75 again.

    Does it help ?

    Regards

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