I have two different forms (Class1 and Class2) which are similar and both of them have object ComboBox1. Because these ComboBoxes have same list of values I created Public subroutine in one of Modules to run certain macro when certain value from ComboBox is selected:
Also I call this subroutine with RunMacro1 (Class1) but it gives me an error: "Object doesn't support this property or method".
I figured out that I can not write FormName.ComboBox1 to reference to an object but how can I do this?
Code:
Public Sub RunMacro1 (FormName As Object)
If FormName.ComboBox1.Value = "Birthday" Then
Macro1_click
End If
End Sub
Also I call this subroutine with RunMacro1 (Class1) but it gives me an error: "Object doesn't support this property or method".
I figured out that I can not write FormName.ComboBox1 to reference to an object but how can I do this?