I want to refer to the CONTENTS of a declared public variable in a function. The idea is this:
Public strPrimarySecID As String
Public Function Change_Text_Control(a_strControl As String, a_Variable As String)
If Me.Controls(a_strControl).Value <> Me.a_Variable.Value Then
Me.Controls(a_strControl).BackColor = RGB(240, 255, 41)
Me.Controls(a_strControl).BackColor = RGB(255, 255, 255)
I want to use the same function for ALL controls on the form, or at least the ones that contain strings. (I figure a separate function each for Strings, Numbers and Booleans.)
The "Me.Controls" form allows the specific control to be referenced as a variable. I want the same thing for the Public Variable I have declared, so I can compare the value in the control to the value in the variable and - if it is different - change the control backcolor. Is there some similar syntax for the VARIABLE that will allow me to compare the CONTENTS?