UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Multiple Sub Data Tables to Total    
 
   
BSul72
post Jun 3 2009, 11:12 AM
Post #1

New Member
Posts: 4
From: New Hampshire



I have many "sub" tables and corresponding forms that I am using to generate a total in a main form. However, when I generate more than one expression in the main form query (one expression to sum the data from each of the "subs"), I am getting what I guess you could call duplicate sums. The query is returning a result for the first record in the first sub with the first record from the second sub, then the first record of the first sub with the second record of the second sub, and so on. I also created queries to do the work (as opposed to creating the expressions in the main form query), but I am getting the same result.

I am assuming this is a relationship issue, or maybe I can't use multiple "detail" items to create a total, unless there is something else I'm am missing. All subs are linked to the main with a QuoteID. I have tried different combinations of relationship types, but with the same results. I'm not completely new to this but I'm certainly not an expert. Any help I could get would be great.

Thanks,


Brian
Go to the top of the page
 
+
mike60smart
post Jun 3 2009, 11:49 AM
Post #2

UtterAccess VIP
Posts: 8,469
From: Dunbar,Scotland



Hi Brian

Can you upload your Db?

Mike
Go to the top of the page
 
+
fkegley
post Jun 3 2009, 02:01 PM
Post #3

UtterAccess VIP
Posts: 23,583
From: Mississippi



It sounds like a cross-product to me. The queries are not related in any way to each other and one or more of them returns more than 1 record. Since the queries are not related, Access has no way to match a record from query1 with its corresponding record in query2, etc. Therefore it is producing a recordset that includes all possible combinations.

If the queries have a common field, then you can join them on that field and get an intelligently-matched recordset.

If each query only returned one record, then you would have exactly what you want.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 05:00 PM