Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2008

Tip: Looking for answers? Try searching our database.

userform validation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
O''Dell - 05 Mar 2008 20:43 GMT
Hi,

I have a userform with several text and combo boxes.  The last object on the
page is an optionbutton.  How do I force the user to fill in all the
text/comboboxes before allowing the option button to be selected? The
optionbutton will open another userform and I'd like the first form to be
complete prior to opening the second.

Thanks-
O'Dell
fumei - 05 Mar 2008 20:59 GMT
This is a logic and design question.

What is an "optionbutton"?  Never heard of one.  Commandbutton, yes.

"to be selected" - this is part of the logic issue.  If what your
optionbutton is, is actually a CommandButton, then you can start your logic
when it executes....not when it is selected.

CommandButton_Click()
  check all the stuff needed to check
  IF everything OK THEN
        open other userform
  ELSE
        set focus on offending missing whatever
  END IF
 
"How do I force the user to fill in all the text/comboboxes before allowing
the option button to be selected?"

By checking them, and seeing if they are filled in.

>Hi,
>
[quoted text clipped - 6 lines]
>Thanks-
>O'Dell
ODell - 05 Mar 2008 22:54 GMT
Fumei,
Thanks for your reply.
I have three Optionbuttons (from userform toolbox) in a frame, not a command
button.  Only one can be "selected" or chosen.  I will apply your advice to
use the "If/Then" logic and see how it goes.  One follow up question...how
would I set the focus on an empty text/combo box?

O'Dell

> This is a logic and design question.
>
[quoted text clipped - 27 lines]
> >Thanks-
> >O'Dell
Doug Robbins - Word MVP - 07 Mar 2008 11:55 GMT
[Controlname].SetFocus

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Fumei,
> Thanks for your reply.
[quoted text clipped - 42 lines]
>> >Thanks-
>> >O'Dell
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.