CodeItBetter Programming Another VB Programming Blog

How to use validate event to check whether a text box is empty or not

Posted on January 4, 2009
1
2
3
4
5
6
7
8
'Controls - How to use validate event to check whether a text box is empty or not
Private Sub txtRequired_Validate(Cancel As Boolean)
    ' Check that field is not empty.
    If txtRequired.Text = "" Then
        MsgBox "Please enter something here", vbExclamation
        Cancel = True
    End If
End Sub
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.