View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Matt Matt is offline
external usenet poster
 
Posts: 516
Default Need ComboBox to require entry before moving to next control

Hopefully you see this
I am needing the same thing only my situation requires 1 of 3 checkboxes to
be selected. If not then it won't advance.

Validation is mentioned. How is this done? I can not get it to work.

Thanks
Matt

"Tom Ogilvy" wrote:

Use the exit event of the combobox to force an entry.


Private Sub ComboBox1_Exit(ByVal _
Cancel As MSForms.ReturnBoolean)
if Combobox1.ListIndex = -1 or Combobox1.value = "" then
Cancel = True
msgbox "You must select an item"
end if
End Sub

If the user uses the mouse and doesn't ever select the combobox, then this
code will never fire. You would need some type of validation routine in
the events related to commiting the data.

--
Regards,
Tom Ogilvy




"JennLee" wrote:

How do I code to ensure that the user can't tab to the next control without
making a choice in current control? It's pertinent that they don't skip some
of my controls when entering their data.
Thanks in advance for any guidance
--
Jennifer Lee
IS Coordinator/App Support