User forms - blank fields

S

Stuart Holley

Hi

Is there a easy way of checking a form for blank details and letting
the user know that they must put something in the text boxes.


Regards

Stuby
 
H

Harald Staff

Hi Stuby

No, not really. You have to check each and every one, which I suspect isn't
in your "easy way" category.

But it's only code, and useful too. Pour a mug of coffee, write it and it's
done.

HTH. Best wishes Harald
 
S

Stuby

Many thanks

Did think there was one, After the coffe will need some bandaids for
my fingers :)

Stuby
 
H

Harald Staff

Famous last words<vbg>/

You have no idea how much time I spend writing input validation code. Form
resizing code is perhaps the only thing I spend more time on. So don't even
try... ;-)

Best wishes Harald
 
D

DennisE

Stuart,
I continually face the same problem as you, and this is basically how I address
it in my program. I keep calling this routine till the message is no longer
issued.

Sub CheckData()
Dim ctl As Control
For Each ctl In MyUserForm.Controls
If TypeName(ctl) = "TextBox" and _
ctl.Text = '' ''
MsgBox "Hey, fella, you forgot to _ enter data for " &
ctl.Name
End If
Next ctl
End Sub
 
Top