wordpress statistics
  • Today is Friday, February 10, 2012

5 Responses to “CREATE TEXT FILE FROM MSACCESS”

  1. This post is invaluable, I completely liked it, I will be back for much more!

  2. Rhyddion says:

    Can you use this same a.writeline to write more than one line of code. I am trying to make a text file and merge in values from a form into the text document im creating. I wanted to use reports as its easier, but i cant find a function to spit out a .txt file of the document. All im trying to do is create a html page based on table values and save it to location on my C:drive

  3. a.p.r.pillai says:

    Yes, you can repeat the a.Writeline() statement with values to write into the text file as many times as you like. Each item will be written on a separate line.

  4. gargle goole says:

    this is a stupid webssiteeeee, if ur gunna make a website atleast make it useful,u freakss..
    this did not help at all….
    ill make sure no one sees this site again
    all i wanted to kno is how to create a textfile step by step and u cant even show me that
    uselessss!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  5. wrottier says:

    If you are trying write a text file based on information in a form:
    Go to the form design view
    Insert a new button
    Right-click the button, go to the event tab and select the … for “On Click”
    Select the code builder option and enter the code:

    Dim fs As Object, a, txtline
    On Error Goto ReadTextFile_Err
    Set fs = CreateObject(“Scripting.FileSystemObject”)
    Set a = fs.opentextfile(“C:\mytest.txt”)
    txtline = a.writeline
    a.Close
    MsgBox “C:\mytest.txt File contents : ” & txtline

    ReadTextFile_Exit:
    Exit Sub

    ReadTextFile_Err:
    Msgbox Err.Description,,”ReadTextFile”
    Resume ReadTextFile_Exit
    End Sub

    The line txtline = a.writeline is where you would but the body of your message enclosed in parenthesis (). You can then insert text inside of ” ” or field using the & Field Name &. If you want a new line enter vbCrLf _ at the end of the line. Each new line must start with &

    For Example:
    & “This survey was completed by ” & Contact & ” (” & Contact_Title & “) on: ” & Date_Called & vbCrLf & vbCrLf _

Leave a Reply

You must be logged in to post a comment.