I have a form1 (frmEmployee_Audits) that has a subform (frmQuality_Review_Subform
). There is a combo box (cboRegion) on form1 (frmEmployee_Audits) that if the user chooses "East" that the combo box (cboQualRevCriteria) on the subform (frmQuality_Review_Subform
) should change to a specific listing that is in a table called "tblCode_East", otherwise it should change the combo box on the subform to list the data in a table called "tblCode_West".
I have posted my code below in the Code box. When I run my code I get an error saying that it can't find the form "frmQuality_Review_Subform
" referred to in a macro expression or Visual Basic Code, and the combo box dropdown(cboQualRevCriteri
a) on the subform (frmQuality_Review_Subform
) is blank.
I have the code on the Deactivate Event Procedure.
What am I doing wrong?
Private Sub Form_Deactivate()
If Me.Region = "East" Then
Forms!frmQuality_Review_Subform!cboQualRevCriteria = "Combo Box"
Forms!frmQuality_Review_Subform!cboQualRevCriteria.RowSource = "select * from tblCode_East"
Forms!frmQuality_Review_Subform!cboQualRevCriteria.RowSource = "select * from tblCode_West"