Assigning a subform to a variable using VBA
Posted on 2003-11-13
I am trying to compare a value on the main form with the value on a subform. I have assigned the main form to a variable and it works fine (see below):
Dim strParent As String, strCPersonal As String
Let strParent = [Forms]![frmempinfo]![EmpNumber]
Then, I assign the subform to a variable and I receive the error that MS Access is unable to find the form. Make sure it is spelled correctly and that it exists.
Let strCPersonal = [Forms]![frmChildPersonal]![EmpNumber]
frmChildPersonal is what I named the subform via the main form. The actual name of the form is frmDISPersonal. I tried to replace that with the frmChildPersonal and I received the same error message.