User forms - blank fields

  • Thread starter Thread starter Stuart Holley
  • Start date Start date
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
 
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
 
Harald Staff said:
Hi Stuby


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

Famous last words<vbg>/

Bob
 
Many thanks

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

Stuby
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top