B
Bryan
I pass my form's collection of controls to a public sub in a module
that loops through and checks for any ErrorProvider text. The sub
returns all the ErrorProvider strings that were found for display in a
msgbox to let the user know that there were data errors found. This
works great, however, sometimes a user does not ever enter a certain
control, therefore that control's validating event is never called, so
my Error collecting sub will not return anything for this control. I
need to be able to loop through all controls on a form and call each
control's validating event. I need this code to be reusable for
multiple forms. Any suggestions.
This does not work:
Public Function CallEventOfCtrl( Controls as controlcollection) as
string
for each c as control in Controls
c.Validated
'or
call c.validated
next
End function
that loops through and checks for any ErrorProvider text. The sub
returns all the ErrorProvider strings that were found for display in a
msgbox to let the user know that there were data errors found. This
works great, however, sometimes a user does not ever enter a certain
control, therefore that control's validating event is never called, so
my Error collecting sub will not return anything for this control. I
need to be able to loop through all controls on a form and call each
control's validating event. I need this code to be reusable for
multiple forms. Any suggestions.
This does not work:
Public Function CallEventOfCtrl( Controls as controlcollection) as
string
for each c as control in Controls
c.Validated
'or
call c.validated
next
End function