Hi Experts,
I have a small form on which a user captures data. I need to validate the input of several text boxes ....
In the Validting event of each textbox I have the code that validates the input of that textbox. If validation (according to my logic) fails, I display a nice error provider control next to the applicable textbox.
Now I want to perform a validation on each control manually when the user clicks OK. I have these text boxes all on a panel to make iteraing through them easy. I wish to loop through these text boxes and force the Validating event on each of them.
How do I achieve this?
I've tried the following which doesn't work:
Private Sub ValidateInput() 'I get called when the user clicks OK
Dim XControl As Control
For Each XControl In Me.pnlValidateInputOnMe.Co
ntrols
XControl.Invalidate()
XControl.Update()
Next
Me.Refresh()
End Sub
Please assist
Thanks
Start Free Trial