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

MS Acess 2010 Expression Builder using queries

Hi there,

I am currently working on an Access 2010 project and I am having some trouble with the expression builder. I have to populate 5 fields using the sum function. I have attached a screenshot of the report for a better idea.

The following 5 fields (Passenger, Agricultural, Truck, ATV and Forklift) need to be populated the "TotalPTE" sum of each respective tire type.

To do this, I wrote 5 different queries which I use in the Expression Builder to get the SUM of the Total PTE for each.

here is the query:

Expand|Select|Wrap|Line Numbers
  1. SELECT ScrapTireType.PTEamount,
  2.  ScrapTireType.description,
  3.  ScrapCollectionTireType.amount,
  4.  ScrapCollection.regNum,
  5.  ScrapCollection.invoiceNum,
  6.  ScrapCollection.Date,
  7.  ScrapCollection.driverSigned,
  8.  ScrapCollection.retailerSigned,
  9.  ScrapCollection.PTEtotal,
  10.  ScrapCollection.scrapCollectionID 
  11. FROM ScrapCollection 
  12. INNER JOIN (ScrapTireType 
  13.  INNER JOIN ScrapCollectionTireType 
  14.   ON (ScrapTireType.scrapTireTypeID = ScrapCollectionTireType.scrapTireTypeID) 
  15.   AND (ScrapTireType.scrapTireTypeID = ScrapCollectionTireType.scrapTireTypeID)) 
  16.  ON ScrapCollection.scrapCollectionID = ScrapCollectionTireType.scrapCollectionID 
  17. WHERE (((ScrapTireType.PTEamount)=[Reports]![RPTEDetailsEndDate]![amount]) 
  18.   AND ((ScrapTireType.description)="Passenger") 
  19.   AND ((ScrapCollection.regNum)=[Forms]![PTEDetailsNew]![regNum]) 
  20.   AND ((ScrapCollection.Date)<=[Forms]![PTEDetailsNew]![endDate])) 
  21. ORDER BY ScrapCollection.Date DESC;
When I run this query, I get the right data. But when I run the report, I am prompt to enter the amount parameter. Not to sure why. I have also attached my expression from the expression builder and a screenshot of the prompt.

I would really appreciate any help. I don't want to be prompted for the amount when the query returns it with no problem.





Thank you
Attached Images
File Type: jpg ExpressionBuilder.jpg (19.8 KB, 522 views)
File Type: png Prompt.png (9.4 KB, 488 views)
File Type: jpg Report.jpg (23.2 KB, 509 views)
May 28 '12 #1
1 2384
zmbd
5,501 Expert Mod 4TB
Sorry for the delay... when the board is busy, the posts sometimes scroll off the bottom of the list.

The issue is in the WHERE (((ScrapTireType.PTEamount)=[Reports]![RPTEDetailsEndDate]![amount]) of your sql. It is looking for a value in the "Amounts" field of your report. You need to change this line so that it refers either to a value in an open form, a table, or a query.

I can only guess that why you are not prompted for a value when you open the query is because the field is referenced correctly within in the sql.

-z
Aug 27 '12 #2

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

Similar topics

3
by: Fran Zablocki | last post by:
I am trying to write an expression that converts one set of values to another. There are two fields, STAGE and ADMIT_TYPE, which are used as input criteria, and the final converted values are...
1
by: Grant Hammond | last post by:
I assume I'm not alone in my frustration that the expression builder that comes (in part) with Access XP that dosnt wrap text when you open it on an exisitng expression in a query or form. I's...
1
by: Laertes | last post by:
Hi, I want to use the expression builder in a query to define a field. I know how to do it for simple fields, like the one below : orderdate: IIf((IsNull() And =False) Or (<>"N/A" And...
2
by: Mike Turco | last post by:
I like using the expression builder for a lot of different things but it isn't always available when I want to use it, for example in the code window, or in all of the control properties. I am...
3
by: Nigel C | last post by:
My problem is best explained by way of tables and examples... I am using Access 2000 (in case this is relevant) and I have a table with the following fields... Field names ------------ Code ...
1
by: Don | last post by:
I'm trying to build a simple report. It will show debtors, budgeted amounts and how much was actually paid to those debtors. I've tried using the expression builder, though I've never used it...
0
by: AlexanderTodorovic | last post by:
Hello Everyone, I'm developing a client application in which the users need an expression builder as provided in MS Access 2003. I would like to use the expression builder in a C# application....
3
by: rrosynek | last post by:
I have a 2003 Access Database with several tables related in a one to many relationship with a parent I am looking to build a report which evaluates if different users of the table have all entered...
18
by: emajka21 | last post by:
Access 2000, I am trying to add a "Summed" total to a report (in a grouped footer section). But I only want to sum the top 3 items. I know how to write this in sql but it seems I can't get a to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.