PKisielewski
04-08-2008, 02:46 PM
Does anyone know how to validation a combobox?
I have a userform which has multiple items on it but there is one combobox that I would like to validate that it is not blank. I have completed this in javascript but I can't figure out how to do this in Word. I would like that after the user selects the ok (commanbutton) that it will check that combobox; verify that it is not blank - if blank - it could open up a message prompt telling the user that they need to select a questionnaire. The userform will not close and the user can complete that field and select ok again. (I did look at the exit code for the combobox but if the user skips over the combobox then the exit code will not run.)
The following is the start of the code
If ComboBox16.Text = "" Then 'If questionnaire is blank
Application.ScreenUpdating = False
MsgBox "You are required to select a Questionnaire - Please try again.", , "Message"
Else
Continue....... ' Field is not blank
End If
Hope that I have explained myself so you can understand what I am trying to accomplish.
Thanks in advance for your help.
I have a userform which has multiple items on it but there is one combobox that I would like to validate that it is not blank. I have completed this in javascript but I can't figure out how to do this in Word. I would like that after the user selects the ok (commanbutton) that it will check that combobox; verify that it is not blank - if blank - it could open up a message prompt telling the user that they need to select a questionnaire. The userform will not close and the user can complete that field and select ok again. (I did look at the exit code for the combobox but if the user skips over the combobox then the exit code will not run.)
The following is the start of the code
If ComboBox16.Text = "" Then 'If questionnaire is blank
Application.ScreenUpdating = False
MsgBox "You are required to select a Questionnaire - Please try again.", , "Message"
Else
Continue....... ' Field is not blank
End If
Hope that I have explained myself so you can understand what I am trying to accomplish.
Thanks in advance for your help.