Question : should only be 3 records returning 8 in query

Hi,

I'm fairly new to access and just completed what I thought was a pretty good database.  However now that I am being asked to produce certain reports there are definitely flaws.  I have an insurance database where I have a main form that lists the policy information called Policy, a subform that lists the commissions being paid to the insurance agents called SpecialistCommission, and another subform where a referral is being paid to other employees called ReferralCommission (Keep in mind that a referral isn't always paid, but the only thing we are concerned about when tracking the referral is how much was paid, when it was paid, and what agent was it referred to.  When I query just the Policy and SpecialistCommission forms the data is perfect as it is when I query just the Policy and ReferralCommission Forms.  But when I query all 3 forms I am getting massive duplication.  The reason I query the 3 forms is that all the I may want to find out on Policy 123 John Doe referred it to Sam Smith and what the revenue was.  Now keep in mind that referrals can be paid multiple times on a single policy so let's say that John Doe was paid 3 times for referring it let's say twice he was paid $20 on July 1 and once $10 on July 30 but Sam Smith may have been paid 6 times amounts of $100 as he is the agent and this does happen.  Now if I ask the question how much was John Doe paid on July 1 and who did he refer it to, I'm getting $20 8 times.  This is happening because I think that the way my database is searching is through the Policy everytime it's looking for a solution so because I asked the question who it was referred to it sees Sam Smith's name 6 times.  When I simply want it to see John Doe's name 2 times and then in the field next to it show me Sam Smith's name as the one it was referred to.  Keep in mind if I don't ask the question who was it referred to, all my data is perfect.

Form is called Compensation and the query showing my issues is called ReferralStatementTest

Longwinded but I hope it makes sense

Answer : should only be 3 records returning 8 in query

Can you show me you calling queries? It sounds like you may need to use the Disctinct keyword...
Random Solutions  
 
programming4us programming4us