Need ComboBox to require entry before moving to next control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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, 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
 
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.
 
I'm just now able to apply these instructions and it worked beautifully!!
Just what I needed.
Thanks so much for your guidance!
 
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
 
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.
 
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
 
Never mind. I am over thinking it. I am not going to require the selections.

Thanks,
Matt
 

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