Hi All,
New joiner and first time poster, hoping somebody can help me here with what I deem to be a complex issue, but you experts may deem to be simple!
I've created a database that has a main form (frm_Main). Within that main form, there is a tab control with subforms (frm_subform1, frm_subform2, etc) on each tab.
What I would like to happen, is that when Combobox_2 is changed on frm_subform2 then Combobox_1 on frm_subform1 is automatically changed to reflect that.
So far, I have changed the control for Combobox_1 to be:
Code:
=[Forms]![frm_Main]![frm_Subform2].[Form]![Combobox_2].[Column](1)
I have also set this to disabled, so that it cannot be changed.
This correctly changes upon update of Combobox_2 in frm_Subform2 when tested.
I then went onto frm_Subform2 and clicked on Combobox_2 in frm_Subform2. In the Property Sheet of the Combobox_2 control, I changed the AfterUpdate to be [Event Procedure]. I then clicked on the 3 dots to open up VBA.
I then have the following code within the VBA script:
Code:
Private Sub Combobox_2_AfterUpdate()
With Me.frm_Main.frm_Subform1.Form
!Combobox_1 = frm_Subform2.Combobox2
.Dirty = False
End With
End Sub
When I go back to frm_Subform2, to test the code out and make a change in Combobox_2, the code runs, however I get the following error:
Code:
Compile error:
Method or data member not found
The following VBA code is automatically highlighted:
As far as I'm aware, I have done the coding correctly, but I must be missing something as it's coming up in error.
Any help? I can provide a copy of the database/screenshots if required. The names of the forms/controls are different within the actual database, but for the purpose of this explanation, I have simplified them. I hope this is okay?
Thanks in advance and apologies for the long post.