473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Access 2007 Reports - can't find field in group header

122 100+
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:
Expand|Select|Wrap|Line Numbers
  1. ="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:
Expand|Select|Wrap|Line Numbers
  1. Run-time error '2465':
  2.  
  3. 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:
Expand|Select|Wrap|Line Numbers
  1. OrderNumber as Long,
  2. ContactName as Text,
  3. CompanyName as Text,
  4. SalesDate as Date/Time,
  5. Branch as Text,
  6. ProjectNumber as Integer,
  7. ProjectCost as Double
  8.  
May 4 '10 #1

✓ answered by Jim Doherty

Expand|Select|Wrap|Line Numbers
  1. ="Current Projects for " & IIf(IsNull([Branch]),[CompanyName],[Branch])

3 3648
Jim Doherty
897 Expert 512MB
Expand|Select|Wrap|Line Numbers
  1. ="Current Projects for " & IIf(IsNull([Branch]),[CompanyName],[Branch])
May 5 '10 #2
gershwyn
122 100+
Thank you. That was... a lot simpler than I was expecting. That solves my problem, but can anyone explain why I was getting the error I was getting? Isn't the Nz function essentially the same as writing out an IIF IsNull statement?
May 5 '10 #3
NeoPa
32,556 Expert Mod 16PB
Strange one :S

I would add a function call in your formula, which included both items as parameters, after your Nz() call which uses Debug.Print to display the items passed. This way you can see what is actually available to the Nz() call. I see nothing obvious as to why this would not have worked. I would certainly recommend usage of Nz() over IIf() if it works.
May 5 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
3
by: Jason.Forget | last post by:
I have created a 4 Reports using the Reports Wizard in Access 2003 and the text in a memo field is being cut off. This is an inconsistent issue being that it is affecting just one of the reports. ...
2
by: Wayne | last post by:
I've been having a click around Access 2007 this afternoon and have discovered some things that range from annoying to alarming. My Access 2003 menu bars, which I, like many others, use...
4
by: lupo666 | last post by:
Hi everybody, this time I have three problems driving me nuts :-((( (1) I have a report with 20 or so Yes/No "squares". Is there a way to either hide/show the "square" or change the yes/no...
2
by: nduerr | last post by:
I have a table with pdf files stored in an attachment data type field in a 2007 Access File. I would like to run a query that would select a group out of this table (easy part) then send the pdf...
5
by: CindySue | last post by:
I'm using a subform linked to the main form by a bidder number field. In the subform, I added a group header and put the field LS in it so that it would list all records designated as Live first...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.