Hello masters,
I want to know how to check an empty textbox in the form.
I can check it by assign Text1.Text = "".
But i have many textbox in form.
Thank you in advance
Hello masters,
I want to know how to check an empty textbox in the form.
I can check it by assign Text1.Text = "".
But i have many textbox in form.
Thank you in advance
Try this :
Dim ctrAs Control
For Each ctr In Me.Controls
If TypeOf ctr Is TextBox Then
If ctr.Text= vbNullString Then
MsgBox "Textbox empty"
ctr.SetFocus
Exit Sub
End If
End If
Next ctr
Thank you sir for wonderful code..
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.