I've been trying to create a generic validation routine in the click event of a save button <br>
for a form containing data. The validation for every control is held in the validate event of<br>
each control (this is a generic function also in each control) <br>
<br>
What I can't understand is how do you call the validate event for every control in your<br>
code. The following below is nearly right except for the line<br>
<br>
Call lc_Control_Validate(False)<br>
<br>
it doesn't see the validate event with this <br>
<br>
If I use something like <br>
<br>
Call txt_WeightValue_Validate(False)<br>
<br>
This will work because it sees the control.<br>
<br>
<br>
Is there something about using a local holder for the control which makes it not see<br>
the events. If so then you will not be able to cycle through each control and initiate an<br>
event???<br>
<br>
<br>
dim lc_control as control <br>
<br>
'validate every control again seeing they may not have entered all controls<br>
'any with validation will be shown<br>
For Each lc_Control In Me.Controls<br>
On Error Resume Next<br>
<br>
Call lc_Control.Validate(True)<br>
Next<br>
On Error GoTo 0<br>
<br>
<br>
Thanks<br>
<br>
Marlin
for a form containing data. The validation for every control is held in the validate event of<br>
each control (this is a generic function also in each control) <br>
<br>
What I can't understand is how do you call the validate event for every control in your<br>
code. The following below is nearly right except for the line<br>
<br>
Call lc_Control_Validate(False)<br>
<br>
it doesn't see the validate event with this <br>
<br>
If I use something like <br>
<br>
Call txt_WeightValue_Validate(False)<br>
<br>
This will work because it sees the control.<br>
<br>
<br>
Is there something about using a local holder for the control which makes it not see<br>
the events. If so then you will not be able to cycle through each control and initiate an<br>
event???<br>
<br>
<br>
dim lc_control as control <br>
<br>
'validate every control again seeing they may not have entered all controls<br>
'any with validation will be shown<br>
For Each lc_Control In Me.Controls<br>
On Error Resume Next<br>
<br>
Call lc_Control.Validate(True)<br>
Next<br>
On Error GoTo 0<br>
<br>
<br>
Thanks<br>
<br>
Marlin