prowler2
asked on
Assigning a subform to a variable using VBA
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]![EmpN umber]
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] ![EmpNumbe r]
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.
~CJ~
Dim strParent As String, strCPersonal As String
Let strParent = [Forms]![frmempinfo]![EmpN
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]
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.
~CJ~
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The responses are not emailed,...only notification that a question has had a comment posted to it.
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: jadedata {http:#9741751}
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
stevbe
EE Cleanup Volunteer
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: jadedata {http:#9741751}
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
stevbe
EE Cleanup Volunteer
ASKER
-CJ