Hello,
I would like to hide/display some fields on a report when it is open basing on the value in [currencyName] field. The field is already defined in the report's record source. The definition is OK as the field is displayed correctly on the report when no VBA is run.
The field is located in report's heading.
Once the code is run I get the following error: "Runtime error 2465 report can't find the field currencyName" which is triggered by the first line of the IF statament.
Code:
If Me.currencyName = "EUR" Then
' do something
End If
I tried to put the code in different locations (report event, heading event) and also tried referencing the field using "Report!...." syntax but still get the same error
I do not know why the error is displayed and how to fix it.
Thank you for any hints.