Continuous form duplicates issue

driver7408

Registered User.
Local time
Yesterday, 18:36
Joined
Feb 7, 2010
Messages
72
I am using a continuous form which is strictly for reference (user enters no information.) It is a list of names from one table, and to the right of the names it has a spreadsheet appearance with a box conditionally formatted based on certain events for each day of the month. (Customer insists on a calender type spreadsheet because they need to reference all of the dates and names at once.)

The issue is since some of the names are tied to more than one date in related tables, the name is showing up twice on the form from the form's query. What can I do to my query to make the name show up only 1 time, but still retain the multiple dates that go with each name?

PNAME______ S M T W T F S S M T W T F S
Jones ________ X
Smith _____________X
Rogers _________________X____X
Rogers _________________X____X <------(This is what I don't want. I just want 'Rogers' to appear once, but with both dates still available in the record.

I know it is possible. I just cant quite figure out how to do it.
I am assuming I need to run multiple queries; my SQL is really not up to par yet.

This is the query I have right now:

SELECT qryAllEnl.EName, tblROSTER.SSN, tblLeave.DateLeave, tblLeave.DateReturn, tblSchool.SchoolStart, tblSchool.SchoolEnd, tblNoFly.NoFlyDate, tblEventsBN.BNStartDate, tblEventsBN.BNEndDate, tblEventsCO.COStartDate, tblEventsCO.COEndDate, tblROSTER.DEROS, tblCQSchedule.DutyDate
FROM ((((((tblROSTER INNER JOIN qryAllEnl ON tblROSTER.SSN = qryAllEnl.SSN) LEFT JOIN tblCQSchedule ON tblROSTER.SSN = tblCQSchedule.SSNID) LEFT JOIN (tblEventsBN RIGHT JOIN tblJCTNEvenstBN ON tblEventsBN.ID = tblJCTNEvenstBN.BNEventID) ON tblROSTER.SSN = tblJCTNEvenstBN.SSNID) LEFT JOIN (tblEventsCO RIGHT JOIN tblJCTNEvenstCO ON tblEventsCO.ID = tblJCTNEvenstCO.COEventID) ON tblROSTER.SSN = tblJCTNEvenstCO.SSNID) LEFT JOIN tblLeave ON tblROSTER.SSN = tblLeave.SSNID) LEFT JOIN tblNoFly ON tblROSTER.SSN = tblNoFly.SSNID) LEFT JOIN tblSchool ON tblROSTER.SSN = tblSchool.SSNID
GROUP BY qryAllEnl.EName, tblROSTER.SSN, tblLeave.DateLeave, tblLeave.DateReturn, tblSchool.SchoolStart, tblSchool.SchoolEnd, tblNoFly.NoFlyDate, tblEventsBN.BNStartDate, tblEventsBN.BNEndDate, tblEventsCO.COStartDate, tblEventsCO.COEndDate, tblROSTER.DEROS, tblCQSchedule.DutyDate;


Thanks for any advice!
 
Too many joins in the query will cause duplicate records. So you need to break it down and consider using subforms.
 

Users who are viewing this thread

Back
Top Bottom