I'm trying to set up a value for a control on the report and part of the path should be a variable, since I have multiple objects like that. So when I try to put a variable I'm getting the "Compile Error: Syntax Error" message and don't know how to handle it.
Reports!rptFlgTest!"& strFieldName &" = -1
I've tried to put single quotes around double ones as well as not to use any; or not to use ampersands while having either single quotes or double ones or both and nothing worked! In the hardcoded version, however, i.e. when the actual name of the check box on the report is hardcoded in the path, like
Reports!rptFlgTest!CheckBox1 = -1
the code compiles and assigns a value to the control like it is expected.
Anybody knows what syntax I should use for a variable?