ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need ComboBox to require entry before moving to next control (https://www.excelbanter.com/excel-programming/385258-need-combobox-require-entry-before-moving-next-control.html)

JennLee

Need ComboBox to require entry before moving to next control
 
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

Charles Chickering

Need ComboBox to require entry before moving to next control
 
Jennifer, Setup your controls with the "TabStop" and the "Enabled" properties
initially set to false, then in the combobox change event, set them to true
as needed:
Private Sub ComboBox1_Change()
If ComboBox1.Value = "My Criteria" Then
CommandButton1.TabStop = True
CommandButton1.Enabled = True
End If
End Sub


--
Charles Chickering

"A good example is twice the value of good advice."


"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


Tom Ogilvy

Need ComboBox to require entry before moving to next control
 
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


JennLee

Need ComboBox to require entry before moving to next control
 
I'm just now able to apply these instructions and it worked beautifully!!
Just what I needed.
Thanks so much for your guidance!
--
Jennifer Lee
IS Coordinator/App Support


"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


Matt

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


Dave Peterson

Need ComboBox to require entry before moving to next control
 
If you need exactly 1 of three options selected, why not drop the 3 checkboxes
and use 3 optionbuttons? That's the way they behave--no more than one can be
chosen.

Matt wrote:

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


--

Dave Peterson

Matt

Need ComboBox to require entry before moving to next control
 
Actually it can be any one of the person would choose 1 or 2 items.

"Register only", "SCOTA Info", "Update Email"

Both infos could be chosen or "register only" would be chosen.

This is being used for a booth at Hamvention. Then I will sort for an email
list (x2). The "register only" would be used for total numbers only.

Matt, kc8bew

"Dave Peterson" wrote:

If you need exactly 1 of three options selected, why not drop the 3 checkboxes
and use 3 optionbuttons? That's the way they behave--no more than one can be
chosen.

Matt wrote:

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



Matt

Need ComboBox to require entry before moving to next control
 
Never mind. I am over thinking it. I am not going to require the selections.

Thanks,
Matt


All times are GMT +1. The time now is 04:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com