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:
Dim sFileText As String Dim iFileNo As Integer iFileNo = FreeFile 'open the file for writing Open App.Path & "\collectedData.txt" For Output As #iFileNo 'please note, if this file already exists it will be overwritten! 'write some example text to the file Print #iFileNo, CollectData1.text 'close the file (if you dont do this, you wont be able to open it again!) 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!




Reply With Quote