I have a report that summarizes the costs for various projects, based off a query called ProjectCosts (outlined below.) The report is grouped first by companyNumber, then by branch. Branch can be null for companies that have only one location. The problem I am having is that I put a text box in the branch GroupHeader which displays a title for that section of the report. The controlSource for this control is:
- ="Current Projects for " & Nz([Branch], [CompanyName])
which should display the name of the branch if there is one, and the name of the company if there is not. This works if the branch is not null, but if it is I get an error. I put a function in the onFormat event to figure out what the error is, and it tells me:
- Run-time error '2465':
-
-
Microsoft Office Access can't find the field 'Branch' referred to in your expression.
...though it has no trouble finding the field called CompanyName. Does this have something to do with what data is available to a report in a specific section (something I know next to nothing about)? Can anyone suggest a way to get around this problem? Thanks for taking the time to help.
Here are the details on the query it is pulling from:
-
OrderNumber as Long,
-
ContactName as Text,
-
CompanyName as Text,
-
SalesDate as Date/Time,
-
Branch as Text,
-
ProjectNumber as Integer,
-
ProjectCost as Double
-