You may want to check that when user presses Ok-button (or any similar button):
Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOk.Click
' Check empty text
If Me.txtInterestRate.Text.Trim = "" Then
MessageBox.Show("Please enter interest rate", _
"Missing Information", _
MessageBoxButtons.OK, _
MessageBoxIcon.Warning)
Me.txtInterestRate.Focus() ' Set focus to field if you want
End If
End Sub
or "integrate" this with rapture's answer:
If Me.txtInterestRate.Text <> ""
/// do all of your stuff
Else
MessageBox.Show("Please enter interest rate", _
"Missing Information", _
MessageBoxButtons.OK, _
MessageBoxIcon.Warning)
End If
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Offline 1,024 posts
since Aug 2008