Connecting Tech Pros Worldwide Help | Site Map

New Data Not Carried Through All Queries

Newbie
 
Join Date: Jun 2007
Posts: 10
#1: Jul 11 '07
Hi. I am working in Access 2000 in Windows XP.

The problem I am having is very strange. My database has many tables and queries, but the relevant ones here are Pricing and Targets (table), Calculated Values by Product Group (query), and Savings Calculations (query). The Savings Calculations query is really the one causing trouble. I will include its SQL code here:

Expand|Select|Wrap|Line Numbers
  1. SELECT [Pricing and Targets].Plant, [Product Group Totals].Line, [Pricing and Targets].[Product Group], [Product Group Totals].[SumOfAdj Good Kgs], (([SumOfAdj Good Kgs]/[Pricing and Targets]![2006 FPE])-([SumOfAdj Good Kgs]/[Calculated Values by Product Group]![FPE]))*([Pricing and Targets]![Cost $/lb]*2.2046+[Pricing and Targets]![Conversion Cost ($/lb)]*2.2046) AS [FPE Savings], (([Product Group Totals]![SumOfAdj Good Kgs]/[Pricing and Targets]![2006 Material U])-([Product Group Totals]![SumOfAdj Good Kgs]/[Pricing and Targets]![2007 Target Material U]))*[Pricing and Targets]![Cost $/lb]*2.2046 AS [Material U Savings], [FPE Savings]+[Material U Savings] AS [Total Savings]
  2. FROM [Product Group Totals] LEFT JOIN [Pricing and Targets] ON [Product Group Totals].[Product Group] = [Pricing and Targets].[Product Group];
  3.  
As you can see from the code, it takes its values from Calculated Values by Product Group. Here's its code:

Expand|Select|Wrap|Line Numbers
  1. SELECT [Product Group Totals].Plant, [Product Group Totals].Line, [Product Group Totals].[Product Group], [Product Group Totals].[SumOfAdj Good Kgs], [Product Group Totals].[SumOfAdj Scrap Kgs], [Product Group Totals].[SumOfReclaim Kgs], [Product Group Totals].[SumOfRerun Kgs], [Product Group Totals]![SumOfAdj Good Kgs]/([Product Group Totals]![SumOfAdj Good Kgs]+[Product Group Totals]![SumOfAdj Scrap Kgs]) AS FPE, [SumOfAdj Good Kgs]/([SumOfAdj Good Kgs]+[SumOfAdj Scrap Kgs]-[SumOfReclaim Kgs]-[SumOfRerun Kgs]) AS [Material U]
  2. FROM [Product Group Totals];
  3.  
Whenever I try to open up my Savings Calculations query, it prompts me twice for "Calculated Values by Product Group!FPE" and then shows all fields correctly except those requiring this value are empty - no error even. The strange thing is that the FPE field in Calculated Values by Product Groups is perfectly fine, and that there are other fields in Savings Calculations that are calculated with fields from the same place that calculate with no problem.

I don't understand why it would do this. This is a query on a query on a query - maybe I have tried to stack too many things on top of each other. However, I never got the impression from any source that this sort of approach would be a problem. Or maybe my table names are too long? I know they're kind of wordy, but that's needed to tell them apart because I have so many that are so similar.

I will greatly appreciate any ideas on what is causing this silliness. I am all out.
Expert
 
Join Date: May 2007
Posts: 91
#2: Jul 12 '07

re: New Data Not Carried Through All Queries


[Calculated Values by Product Group] is not included in your FROM clause and Access is interpreting it as a parameter to prompt for.
Newbie
 
Join Date: Jun 2007
Posts: 10
#3: Jul 12 '07

re: New Data Not Carried Through All Queries


Thank you so much! Such a stupid mistake, but I might have been able to look at it forever without catching it.
Newbie
 
Join Date: Jun 2007
Posts: 10
#4: Jul 12 '07

re: New Data Not Carried Through All Queries


I fixed it and it's working fine!
Expert
 
Join Date: May 2007
Posts: 91
#5: Jul 12 '07

re: New Data Not Carried Through All Queries


It's amazing what another pair of eyes can see!
Glad it's working.
Reply


Similar Microsoft Access / VBA bytes