Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    139

    Unanswered: invalid procedure call

    I'm getting an invalid procedure call or argument from the following piece of code: Debug is telling me the problem occurs in the "Set a = fs.OpenTextfile," the 8th one down. Access 2002.

    Private Sub write_process()
    'Writes the header and body.

    Dim strHeader As String, strBody As String
    Dim fs, a

    strHeader = "01" & Me!CUST_NUMBER & "," & Me!CUST_NAME
    strBody = "02" & "6" & "," & "1" & "," & Me!TTNUM & "," & Me!TTCode

    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.OpenTextFile("H:\Text_Files\" & Me!TTNUM & " ", True)
    a.WriteBlankLines (1)
    a.Writeline (strHeader)
    a.Writeline (strBody)
    a.Close

    MsgBox "Write Complete"

    End Sub
    Thanks,
    Bill

  2. #2
    Join Date
    Jul 2004
    Posts
    125
    Set a = fs.OpenTextFile("H:\Text_Files\" & Me!TTNUM & " ", True) is wrong. There can be no spaces after the filename & " "

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •