Hi there everyone. The students have been loving the vb programs on the smartboard so I thought I would make a program to help with attedance. The way it works is students come in and move their name to the sign in box and so on.

Anyway what I need to do to finish is be able to record the data from two text boxes and store it on a single line in a single textfile.

I usually use this code for writing from a textbox to a textfile.

VB Code:
  1. Dim sFileText As String
  2.     Dim iFileNo As Integer
  3.       iFileNo = FreeFile
  4.           'open the file for writing
  5.       Open App.Path & "\collectedData.txt" For Output As #iFileNo
  6.     'please note, if this file already exists it will be overwritten!
  7.           'write some example text to the file
  8.       Print #iFileNo, CollectData1.text
  9.           'close the file (if you dont do this, you wont be able to open it again!)
  10.       Close #iFileNo

As you can see I record the attendance records from CollectData1.text, but would like to record a second piece of data from a textbox called CollectData2.text, but both will be saved to a single line in a textfile.


Would anyone be able to tell me how to write from 2 textboxes at once to the same file on the same line? Thanks so much!