I have a form named UI(Navigation Form) in MS Access 2010. I have two more subforms SEARCH and RESULTS as tabbed forms in UI. After I search in SEARCH form, when I click the RESULTS tab I want the value from a combo box named 'cmbID' in SEARCH to be displayed in a label named 'lblAIPIDDisp' in RESULTS form and then display additional labels. So, I gave the following code in the navigation Button Click Event:
-
Private Sub NavigationButton32_Click()
-
Form_RESULTS.lblAIPIDDisp.Caption = [Forms]![UI]![SEARCH].cmbID.Value
-
End Sub
-
But I get Run Time Error 2465. So, I tried searching in SEARCH form separately and gave the following code in Form Load Event of RESULTS form:
-
Private Sub Form_Load()
-
Form_RESULTS.lblAIPIDDisp.Caption = [Forms]![SEARCH].cmbID.Value
-
End Sub
-
Now, I searched in SEARCH Form and clicked on RESULTS form. I was able to see the value in Combo Box 'cmbID' in SEARCH Form in the label 'lblAIPIDDisp' in RESULTS Form. So, I think there is something wrong in referencing subforms RESULTS and SEARCH in the Navigation Form UI. Help needed in this point.