Its me again, sorry but im just stuck on this last thing. I have an insert statement which works fine but before the record is saved I want to validate the text boxes. So I just need to know how to check for empty text boxes before the save button is clicked on. I have seen a couple of examples like:
Dim ctr As TextBox
If ctr.Text = vbNullString Then
MsgBox("empty box")
End If
OR the use of String.empty etc, I just need to know how to include this in a loop before the following statement:
Dim con As SqlConnection
Dim cmd As SqlCommand
con = New SqlConnection(My.Settings.ConnectionString)
con.Open()
cmd = New SqlCommand("insert into CommissionStructure values(" + txtAgentNo.Text + ",'"...etc)", con)
cmd.ExecuteNonQuery()
con.Close()
Thank you

New Topic/Question
Reply




MultiQuote





|