|
-
May 8th, 2001, 11:08 PM
#1
Textbox
suppose i have three textboxes in a form and when i write this code and leave two textboxes empty it is displaying the message twice i.e. if in the form five textboxes r left empty then the message("fields should not be left empty") is displayed five times.please help me out
Public Sub CheckEmpty(frm As Form, ctl As Control)
For Each ctl In frm
If TypeOf ctl Is TextBox Then
If ctl.Text = "" Then
MsgBox " Feilds should not be empty "
ctl.SetFocus
End If
End If
Next ctl
End Sub
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|