#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default userform

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default userform

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

--
Regards,
Tom Ogilvy


"Julie" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default userform

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)


"Julie" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
one userform to another damorrison Excel Discussion (Misc queries) 2 August 26th 06 01:10 PM
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM
Userform No Name Excel Programming 0 July 19th 04 07:23 AM
Userform inside another userform Ryan Excel Programming 0 April 23rd 04 08:01 PM


All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"