Can't see RecordSource fields in OnPage event logic

rbsorensen

New member
Local time
Today, 15:24
Joined
Jan 1, 2009
Messages
8
I am attempting to create a report in which the source record set potentially contains records that need to be displayed in a different manner depending on a record type flag in each record.

The report definition contains a tab control, and each sub-record type is defined within a different tab, so that the code can simply select the appropriate tab prior to printing each page.

In order to implement this, I have placed logic in the report's OnPage event which is supposedly fired prior to printing each page. This code selects the appropriate tab based on a field from the record, and performs other formatting actions.

The problem is that the record field references in the OnPage code (formatted as Me.<FieldName>) returns the following error:

"<Application> can't find the field '<FieldName>' referred to in your expression"

I have tried "Me.Parent..." and "Reports...." but nothing works, and I can't get the OnPage event code to properly reference fields from the current record. However, other non-variable fields elsewhere on the report print correctly, so I know that the record source is correctly specified.

A few other facts about the report definition: the tab control is defined within the Detail section of the report, and I also have a series of labels in the Page Header section to turn on and off depending on the record type. The Report Header and Footer sections are both blank.

How can I make the data from the current record available to the OnPage event logic (the Report_Page routine)? If that is not possible, should I use a different event?
 
I don't think Me. is applicable in this context, just refer to the fields as you you see them in the field list.
 
Last edited:
Unfortunately, that doesn't work either and returns the same error message
 

Users who are viewing this thread

Back
Top Bottom