I have a subform that displays species and count for a specific Depth. I am trying to get a subform to display all species with counts that are either present or missing. I want to do this so counts can be entered for each species when a new record is added for depth. It seems to me that this can be done using the "where not exists", but im not sure how to implement this within a subform.
the relavent subforms are sfmSpeciesCount which is a child of sfrmDepth.
the linkage in sfrmSpeciesCount is
link child
epthID
link master:[sfrmDepth].Form![DepthID]
the relavent relationships are
1:many tblSpecies:tblCount (SpeciesID is linked field)
1:many tblDepth:tblCount (DepthID is linked field)
sfrmSpeciesCount is based on the following query:
SELECT tblCount.DepthID, tblSpecies.Species, tblCount.Count, *
FROM tblSpecies INNER JOIN tblCount ON tblSpecies.SpeciesID = tblCount.SpeciesID
WHERE NOT EXISTS
(SELECT * FROM tblDepth
WHERE DepthID = tblCount.DepthID AND tblSpecies.SpeciesID=tblCount.SpeciesID);
the relavent subforms are sfmSpeciesCount which is a child of sfrmDepth.
the linkage in sfrmSpeciesCount is
link child
link master:[sfrmDepth].Form![DepthID]
the relavent relationships are
1:many tblSpecies:tblCount (SpeciesID is linked field)
1:many tblDepth:tblCount (DepthID is linked field)
sfrmSpeciesCount is based on the following query:
SELECT tblCount.DepthID, tblSpecies.Species, tblCount.Count, *
FROM tblSpecies INNER JOIN tblCount ON tblSpecies.SpeciesID = tblCount.SpeciesID
WHERE NOT EXISTS
(SELECT * FROM tblDepth
WHERE DepthID = tblCount.DepthID AND tblSpecies.SpeciesID=tblCount.SpeciesID);