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!

multiline textbox to update 4 fields in a database

Status
Not open for further replies.

honeypot

Technical User
Mar 6, 2001
147
GB
HI :)
I have a multi-line textbox on my windows form, which should enable users to put in an address. The database that it will update has 4 address fields - address1, address2, address3 & address4. How do i write the code that will enable the textbox to update each field separately, assuming that the 1st line will update address1, the 2nd line will update address2 etc?
 

Use the textBox.Lines collection.

Code:
If TextBox1.Lines.Length > 4 Then
    MessageBox.Show(Me, "Too many lines!")
End If
Dim ln As String
For Each ln In TextBox1.Lines
    MessageBox.Show(Me, ln)
Next

-Stephen Paszt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top