userform

  • Thread starter Thread starter Julie
  • Start date Start date
J

Julie

Hi All,

I have a userform that contains text boxes and combo
boxes and option buttons. Is there an easy way to
determine if all the appropriate controls are filled in?

Thanks
 
for each ctrl in userform1.controls
if ctrl.Value = "" then
msgbox "Not filled in"
end if
Next
 
Julie,

The best way is to have an OK button that checks each control. You can
either test them by name

If Textbox1.Text <> "" Then ...

or in a loop

For Each ctl In Me.Controls
if ctl.Value = "" Then
... maybe do something
End If
Next ctl.

but look upon it as an opportunity, you can test the values for validity at
the same time.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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