473,385 Members | 1,555 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,385 software developers and data experts.

Reporting Error 'Can't Find <fieldname> within the expression'

129 100+
Hi I have created a Purchase Order Report which contains a PO Header Report and a PO Detail Report.

The PO Detail Report contains a Grouping on 'CategoryDescription' followed by the Detail of Stock Items. When i open this query and report up it works fine with no errors.

When i incorporated this sub-report into the PO Header Report it now says that it can't find the 'CategoryDescription'. The Master and Child link between the PO Header and PO Detail is set by the PONo. I can't understand how or why i can't find the 'CategoryDescription', its finds it fine when run on its own but when incorporated into the Header, No.

Does anyone have any suggestions of what i could do? I am using MS Access 2007 as well.
Sep 9 '08 #1
6 1271
Stewart Ross
2,545 Expert Mod 2GB
Hi. This message usually means you have not put a copy of the relevant field onto your report bound to a control. The report will not 'see' the field unless there is a control bound to it somewhere, even though it is a valid field name from the underlying query.

To add that field to your report bound to a textbox control just drag a copy from the field list onto the report at an appropriate location.

The control's visible property can be set to No if you don't need it to be seen within the report.

Let us know how it goes for you.

-Stewart
Sep 9 '08 #2
Constantine AI
129 100+
Hi. This message usually means you have not put a copy of the relevant field onto your report bound to a control. The report will not 'see' the field unless there is a control bound to it somewhere, even though it is a valid field name from the underlying query.

To add that field to your report bound to a textbox control just drag a copy from the field list onto the report at an appropriate location.

The control's visible property can be set to No if you don't need it to be seen within the report.

Let us know how it goes for you.

-Stewart
Sorry for not saying but it is actually visible on the report as well as the query. This is what i can't understand.
Sep 9 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
Hi Constantine Al. Would you mind posting the SQL for your subreport query (or at least a relevant part of it, including the joins and any where clause)? It may work in some circumstances but not in others, and without seeing the expression that A2007 is objecting to I cant really advise further at present.

Thanks

Stewart
Sep 9 '08 #4
Constantine AI
129 100+
Hi Constantine Al. Would you mind posting the SQL for your subreport query (or at least a relevant part of it, including the joins and any where clause)? It may work in some circumstances but not in others, and without seeing the expression that A2007 is objecting to I cant really advise further at present.

Thanks

Stewart
Hi Stewart, no problems.

Here is the SQL syntax for the PO Header Report:

Expand|Select|Wrap|Line Numbers
  1. SELECT sysmas.SysCusName, sysmas.SysCusAddress1, sysmas.SysCusAddress2, sysmas.SysCusAddress3, sysmas.SysCusAddress4, sysmas.SysCusAddress5, sysmas.SysCusPostCode, sysmas.SysCusPhone, sysmas.SysCusFax, sysmas.SysCusMobile, sysmas.SysCusEmail, sysmas.SysCusVatReg, sysmas.SysPaymentTerms, suppmas.SuppNo, suppmas.Forename, suppmas.Surname, suppmas.Salutation, suppmas.CompanyName, suppmas.Add1, suppmas.Add2, suppmas.Add3, suppmas.Add4, suppmas.Add5, suppmas.Postcode, suppmas.PhoneNo, suppmas.MobileNo, pordhdr.PONo, pordhdr.PODate, pordhdr.DueDate, pordhdr.Notes, suppmas.OurAccountNo, ordhdr.OrderNo, pordhdr.DeliveryName, pordhdr.DeliveryAdd1, pordhdr.DeliveryAdd2, pordhdr.DeliveryAdd3, pordhdr.DeliveryAdd4, pordhdr.DeliveryAdd5, pordhdr.DeliveryPostCode
  2. FROM sysmas, pordhdr INNER JOIN (ordhdr INNER JOIN (suppmas INNER JOIN ordlin ON suppmas.SuppNo = ordlin.SuppNo) ON ordhdr.OrderNo = ordlin.OrderNo) ON (suppmas.SuppNo = pordhdr.SuppNo) AND (pordhdr.PONo = ordlin.PONo)
  3. GROUP BY sysmas.SysCusName, sysmas.SysCusAddress1, sysmas.SysCusAddress2, sysmas.SysCusAddress3, sysmas.SysCusAddress4, sysmas.SysCusAddress5, sysmas.SysCusPostCode, sysmas.SysCusPhone, sysmas.SysCusFax, sysmas.SysCusMobile, sysmas.SysCusEmail, sysmas.SysCusVatReg, sysmas.SysPaymentTerms, suppmas.SuppNo, suppmas.Forename, suppmas.Surname, suppmas.Salutation, suppmas.CompanyName, suppmas.Add1, suppmas.Add2, suppmas.Add3, suppmas.Add4, suppmas.Add5, suppmas.Postcode, suppmas.PhoneNo, suppmas.MobileNo, pordhdr.PONo, pordhdr.PODate, pordhdr.DueDate, pordhdr.Notes, suppmas.OurAccountNo, ordhdr.OrderNo, pordhdr.DeliveryName, pordhdr.DeliveryAdd1, pordhdr.DeliveryAdd2, pordhdr.DeliveryAdd3, pordhdr.DeliveryAdd4, pordhdr.DeliveryAdd5, pordhdr.DeliveryPostCode
  4. HAVING (((pordhdr.PONo)=[Forms]![frmSupplierOrderForm]![txtPONo]));
And this is the SQL syntax for the PO Detail Report:

Expand|Select|Wrap|Line Numbers
  1. SELECT catmas.PurchaseOrder, catmas.CategoryDescription, catmas.OrderLevel, Sum(ordlin.Qty) AS SumOfQty, ordlin.WithGrain, ordlin.AcrossGrain, ordlin.StkID, stkmas.StkLongDesc, rngmas.RangeDesc, colmas.ColourDescription, fasmatmas.FasciaMaterialDesc, fasfinmas.FasciaFinishDesc, ordlin.OrderNo, ordlin.PONo, ordlin.Cost, Sum([Qty]*[Cost]) AS LineCost
  2. FROM ((((ordlin INNER JOIN rngmas ON ordlin.RangeID = rngmas.RangeID) INNER JOIN colmas ON (ordlin.ColourID = colmas.ColourID) AND (ordlin.CarcussColourID = colmas.ColourID)) INNER JOIN fasmatmas ON ordlin.FasciaMaterialID = fasmatmas.FasciaMaterialID) INNER JOIN fasfinmas ON ordlin.FasciaFinishID = fasfinmas.FasciaFinishID) INNER JOIN (catmas INNER JOIN stkmas ON catmas.CategoryID = stkmas.CategoryID) ON (rngmas.RangeID = stkmas.RangeID) AND (ordlin.StkID = stkmas.StkID)
  3. GROUP BY catmas.PurchaseOrder, catmas.CategoryDescription, catmas.OrderLevel, ordlin.WithGrain, ordlin.AcrossGrain, ordlin.StkID, stkmas.StkLongDesc, rngmas.RangeDesc, colmas.ColourDescription, fasmatmas.FasciaMaterialDesc, fasfinmas.FasciaFinishDesc, ordlin.OrderNo, ordlin.PONo, ordlin.Cost
  4. HAVING (((catmas.PurchaseOrder)=True))
  5. ORDER BY catmas.OrderLevel, ordlin.OrderNo, ordlin.PONo;
Hope this helps, the master and child link joins are with the PONo, if you need anything else just ask?

p.s. sorry about the klump of sql statements.
Sep 9 '08 #5
Stewart Ross
2,545 Expert Mod 2GB
HI Constantine Al. In themselves the two SQL statements seem fine to me - no obvious glitches. As they are each joining multiple tables it suggests to me that the relationship between the two queries is not likely to be as simple as just on purchase order no alone; the error message may well be arising because the database engine is confused in trying to join the header to the detail and finding it cannot do so on the one joining field when there are so many interrelationships involved.

You would need to be sure that the header query returns just ONE row for each purchase order, and that in the multiple rows of the detail query relating to that purchase order each stock item for that order is returned ONCE and no more than that. If either of these queries returns more than one row per item you will get row multiplication occurring - something called the Cartesian product of the two queries - which could easily lead to database engine confusions such as the one you have had.

-Stewart
Sep 9 '08 #6
Constantine AI
129 100+
HI Constantine Al. In themselves the two SQL statements seem fine to me - no obvious glitches. As they are each joining multiple tables it suggests to me that the relationship between the two queries is not likely to be as simple as just on purchase order no alone; the error message may well be arising because the database engine is confused in trying to join the header to the detail and finding it cannot do so on the one joining field when there are so many interrelationships involved.

You would need to be sure that the header query returns just ONE row for each purchase order, and that in the multiple rows of the detail query relating to that purchase order each stock item for that order is returned ONCE and no more than that. If either of these queries returns more than one row per item you will get row multiplication occurring - something called the Cartesian product of the two queries - which could easily lead to database engine confusions such as the one you have had.

-Stewart
Thanks for the advice, i will look into that tonight!
Sep 9 '08 #7

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

Similar topics

2
by: SAN CAZIANO | last post by:
can you help me please because I can't understand why the code doesn't seems to function very well: in onkeypress it must verify if insert number or string value in the fiels, but it doesn't...
5
by: ad | last post by:
I find there are some tag like <%= %> and <%# > in my .aspx file. What is the diffreence between <%= %> and <%# %>
1
by: ghadley_00 | last post by:
Hi, I have a php form that encodes the responses to various <Select> field drop down menus as numbers (e.g. 0 to 50), and then posts the data to a MySQL table. I am trying to implement a form...
7
by: Wilson | last post by:
Hi, How do get the Dictioanry object from FiedlInfo ? my code : fieldInfo = this.GetType().GetField("dictioanry1"); ??Dictionary<string, string> dicTemp1 = (Dictionary<string,...
1
by: Simon | last post by:
Dear reader, Some times I receive an error message by using the functions: Left(;2) Mid(;5;2)
3
by: xhe | last post by:
I have just upgraded my php version form php4 to php5. and I met this problem, and don't know if you know the solution. My site was written in PHP4, and most parts can be running smoothly in PHP5,...
2
by: gkinu | last post by:
1. I have a table 'Table1' with the fields (student,subject,score ). 2. I create a CrossTabQuery 'QryXTab' to return students performance per subject plus the total. The subject names now appear as...
1
by: prakz | last post by:
<% ' ------------------------------------------------------------------------------ ' Container of Field Properties Class clsField Public FileName Public ContentType Public Value Public...
2
by: Constantine AI | last post by:
Hi i have a main form and sub form with a one to many relationship. The sub-form is constructured of four fields, StaffUserID, AdminID, Hours Assigned and Comment. I have a combo box for the Admin...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.