I have a Public Function that I use to checks text boxes and combo boxes with a "*" in the tag.
If the no "*" in the tag, then it returns a True.
Works great in the BeforeUpdate event of the form and looks like this in the form:
So my problem is, I would like to use this same public function in another form but having trouble with directing it there.
I have a form with a couple of subforms.
Namely, the parent form is F_Contract and the two subforms are SF_ContractInfo and SF_Payments.
In the SF_Payments BeforeUpdate I place the following:
But this give me a "Run-time error '13': Type mismatch" and highlights the light "Cancel = ValidationOfControl(Forms!F_Contract!SF_ContractInfo)" line.
Basically, I have one text box in the SF_ContractInfo subform, named txtAwardDate that has the "*" in the tag. I want the user to input an AwardDate prior to updating the Payment subform.
Am I not referring to the subform correctly?
Note both subforms are in separate tab controls, although I don't think that matters.
If the no "*" in the tag, then it returns a True.
Works great in the BeforeUpdate event of the form and looks like this in the form:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
'ValidationOfControl can be True or False.
'False - all tagged fields have data
'True - one or more tagged fields have missing data
Cancel = ValidationOfControl(Me)
End Sub
So my problem is, I would like to use this same public function in another form but having trouble with directing it there.
I have a form with a couple of subforms.
Namely, the parent form is F_Contract and the two subforms are SF_ContractInfo and SF_Payments.
In the SF_Payments BeforeUpdate I place the following:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Cancel = ValidationOfControl(Forms!F_Contract!SF_ContractInfo)
End Sub
But this give me a "Run-time error '13': Type mismatch" and highlights the light "Cancel = ValidationOfControl(Forms!F_Contract!SF_ContractInfo)" line.
Basically, I have one text box in the SF_ContractInfo subform, named txtAwardDate that has the "*" in the tag. I want the user to input an AwardDate prior to updating the Payment subform.
Am I not referring to the subform correctly?
Note both subforms are in separate tab controls, although I don't think that matters.