I use this code to display errors in the form:
And as you guys might already know just send in the combo boxes one by one to the function for validation. I have at least 30 combo boxes to validate, and validating them one by one is tedious and quite frankly, lengthy. Is there any way I can pass them to the function for validation? They're named like so:Code:Public Sub CheckIndex(ByRef _Control As ComboBox) If _Control.SelectedIndex = -1 Then HighlightError(_Control, errMissing) blnMissing = True End If End Sub
- cboT1Combo1, cboT1Combo2...
- cboT2Combo1, cboT2Combo2...
and so on and so forth. Another question I'd like to ask is, I've already set the SelectedIndex property of each combo box to 0 on load, will the SelectedIndex of those combo box possibly become -1 anytime during runtime?




Reply With Quote