There are two Textboxes & One button on mine form. I save the Textboxes
data to the TextFile on Button click.

I want the data in the TextFile as :

STUDENT RECORD INFORMATION

Roll : 1
Name : Ruchi

Roll : 2
Name : Ruchika

Mine Code is as Under-


Private Sub btnFixNow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFixNow.Click
Call SaveToTextFileOnFixNowButton(textbox1.text, textbox2.text)
End sub

Private Sub SaveToTextFileOnFixNowButton(ByVal Roll As String, ByVal Name As String)
Try

Dim FileNum As Integer
FileNum = FreeFile()
FileOpen(FileNum, "c:\BackUpFile.txt", OpenMode.Append)
PrintLine(FileNum, "Roll : & Roll)
PrintLine(FileNum, "Name : & Name)
FileClose(FileNum)

Catch ex As Exception
MsgBox("Error Occurred Under (SaveToTextFileOnFixNowButton) Procedure in (FrmMain.vb)" & vbCrLf & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub

Mine O/P--

STUDENT RECORD INFORMATION

Roll : 1
Name : Ruchi

STUDENT RECORD INFORMATION

Roll : 2
Name : Ruchika

But I want the Output as Above, Can Somebody Help me Out.

Hi ruchika beddy, I replied to your last post and noticed you abandoned it with no reply. I (like many others) DON'T get paid for helping people out, we do it because we enjoy our work, and want to help others. Firstly, start by answering to the thread you abandoned here. Secondly, ensure the code you paste is enclosed in [ code] tags!

There appears to be no problems with the code above? What exactly are you trying to achieve? Where is it going wrong?

Ok sorry..From Next Time I dreply in code tags...I reply to that post.....Sorry for replying late....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.