writing multiple text boxes to one file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zsolt szabo
    New Member
    • Jan 2012
    • 8

    writing multiple text boxes to one file

    hi, im having problems writing multiple text boxes in one file.

    i`ve got a code, but its stands for save only, and delete any previous information from the file.

    my code:
    private sub command1_click( )
    Dim sTextMixed As String
    'Mixing the textboxes
    sTextMixed = Text5.Text & vbCrLf & Text4.Text
    'Saving it
    Open "C:\sample. txt" For Output As #1
    Print #1, sTextMixed
    Close #1
    end sub

    i`d like to write about 8-15 text box`s several times, and i want each at the end/bottom of the txt file.

    or

    saving the text boxes in one file, and adding the content of the file to the end of another.

    hope you can help me about this..
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    Use the "Append" mode in "Open" =>
    Code:
    Private Sub Command1_Click()
    Dim FILEnmr As Integer
        FILEnmr = FreeFile
        Open App.Path & "\test.txt" For Append As #FILEnmr
            Print #FILEnmr, Text1.Text
        Close #FILEnmr
    End Sub

    Comment

    • zsolt szabo
      New Member
      • Jan 2012
      • 8

      #3
      thanks alot, it worked!

      Comment

      Working...