none
Combobox ignoring data validation RRS feed

  • Question

  • Hello,

    I used the example at http://www.contextures.com/xlDataVal10.html to do some dropdown boxes with data validation.   The dropdown works great, but you can type anything you want in the box (even though it is pulling the data from the data validation).

    I tried this in her example as well (that is located at http://www.contextures.com/xlDataVal10.html) and it does the same thing.   Anyone know how to fix this, so that I can use the combobox dropdown as well as enforcing data validation?

    Tuesday, February 10, 2015 5:56 PM

Answers

  • Hi tonnic.ca,

    Yes you can type anything you want in the ComboBox, but you can't save it if the input value is not in the validation list. You'll receive an error dialog like this:

    You'll get this error message untill you input a correct value.

    If you don't want the user to input anything with keyboard, you could just set the Style property of the ComboBox to "2-fmStyleDropDownList". Or you can ignore the user input in the KeyPress event of the ComboBox.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 11, 2015 7:17 AM
    Moderator
  • Hi tonnic.ca,

    I am able to reproduce this issue. Based on my understanding, the data validation only occured when the cursor disapear the active cell. For example, after we typed the value press Enter key.

    As a workaround, we can check the value in the worksheet change event. Also if you want the data validation feature occur when we set the cell value via code or control, I suggest that you submit the feedback from link below:

    Submit Feedback - Microsoft Support

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 20, 2015 10:06 AM
    Moderator

All replies

  • Hi tonnic.ca,

    Yes you can type anything you want in the ComboBox, but you can't save it if the input value is not in the validation list. You'll receive an error dialog like this:

    You'll get this error message untill you input a correct value.

    If you don't want the user to input anything with keyboard, you could just set the Style property of the ComboBox to "2-fmStyleDropDownList". Or you can ignore the user input in the KeyPress event of the ComboBox.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 11, 2015 7:17 AM
    Moderator
  • Hi tonnic.ca,

    I am able to reproduce this issue. Based on my understanding, the data validation only occured when the cursor disapear the active cell. For example, after we typed the value press Enter key.

    As a workaround, we can check the value in the worksheet change event. Also if you want the data validation feature occur when we set the cell value via code or control, I suggest that you submit the feedback from link below:

    Submit Feedback - Microsoft Support

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 20, 2015 10:06 AM
    Moderator