A2003: How to read value from field in query?

bulrush

Registered User.
Local time
Today, 08:28
Joined
Sep 1, 2009
Messages
209
I made Report1, and in the report's VBA code I can read a field from the query in the recordsouce by doing:
If (Me!Field1="03") then ...

I created a second report from scratch, and copied all code from Report1 to Report2. Report2 has the same appearance except the query is different. But now the Me!Field1 gives me an error in the VBA code in Report2.

What did I forget to set up?

Report2 does use a filter, but so does Report1. So that can't be an issue. And I double checked my fields in the query in Report2 and Field1 is there and spelled the same.

Thanks.
 
What is the error? #Error or a pop-up asking you to input the field name?
 
"Error 2465: Access cannot find the field 'Field1' referred to in your expression."
 
I'm hoping that your fields aren't called Field1, Field2... etc in your actual table?

Are you running the code in the Format or Print event of a section?

Drop the field in the Detail section of your report and set the Visible property of the control to No.
 

Users who are viewing this thread

Back
Top Bottom