Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Form

Status
Not open for further replies.

perltk07

Programmer
Apr 2, 2007
13
US
Hello,

I want to create a simple form using visual basic express 2005. e.g:
Name:
Age:
Adress

Then when the user hits submit, i want the form to write the data entered into a csv file under appropriate columns.

Can some guide me as how that is done in VB.

Thanks
 
Here...this should get you started...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim File1 As IO.TextWriter
'Open a file for Appending
File1 = IO.File.AppendText("c:\temp\yourfile.csv")
'Write a line to the bottom
File1.WriteLine(Trim(TextBox1.Text) & "," & TextBox2.Text)
File1.Close()
File1.Dispose()
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top