R
Ray Cassick \(Home\)
Ok, I have been looking all over fro answers to these two questions and
can't seem to locate anything... I am still looking but figured that I would
drop a query here also....
1) The ErrorProvider control does not seem to offer any way that I can
check the control once to see if it has ANY errors registered for any of the
controls on my form. I have several controls that make use of the
ErrorProvider control and would love to simply do the following form my
forms same button:
If (errProvider.Errors > 0 ) Then
'Stop the save here
Else
'Continue saving the data here
End IF
But I cannot seem to do this. I seem to have to loop through the GetError
method passing in each control as I loop and see if the Length property is >
0. I then increment a counter and then when I am done I check the counter
to see if it is > 0, if it is I stop the save. Seems like a bit more work on
my part. I can't believe that the ErrorProvider doe snot have a simple
Errors collection that I can get a count on, or even an overloaded GetError
method that simply checks for the existence of ANY error...
2) Is it me or does using the Validating event still not work just right?
It seems to require that the user always move off the control explicitly
before it fires. I am not 100% sure if what I am seeing is just something in
my code or something wrong in the forms system (VB6 also has similar issues
if I remember correctly). For example, if I have three text boxes and a save
button, and I fill the data into all three boxes then from the third I just
click onto the save button I don't think I am seeing the third text boxes
validating event firing.
can't seem to locate anything... I am still looking but figured that I would
drop a query here also....
1) The ErrorProvider control does not seem to offer any way that I can
check the control once to see if it has ANY errors registered for any of the
controls on my form. I have several controls that make use of the
ErrorProvider control and would love to simply do the following form my
forms same button:
If (errProvider.Errors > 0 ) Then
'Stop the save here
Else
'Continue saving the data here
End IF
But I cannot seem to do this. I seem to have to loop through the GetError
method passing in each control as I loop and see if the Length property is >
0. I then increment a counter and then when I am done I check the counter
to see if it is > 0, if it is I stop the save. Seems like a bit more work on
my part. I can't believe that the ErrorProvider doe snot have a simple
Errors collection that I can get a count on, or even an overloaded GetError
method that simply checks for the existence of ANY error...
2) Is it me or does using the Validating event still not work just right?
It seems to require that the user always move off the control explicitly
before it fires. I am not 100% sure if what I am seeing is just something in
my code or something wrong in the forms system (VB6 also has similar issues
if I remember correctly). For example, if I have three text boxes and a save
button, and I fill the data into all three boxes then from the third I just
click onto the save button I don't think I am seeing the third text boxes
validating event firing.