show only duplicates that match the current form's contents, how?

E

efandango

I have a conitnuous form with the field [Streetname] that contains lists of
street names whose data appears on other records. I have another form linked
to a show duplicates query that displays which other records have duplicate
addresses to those on my current form, BUt I only want to see a list of
duplicate addresses for the currently diplayed form/record, and not any other
main records. Can this be done?

This is my Address form SQL:

SELECT tbl_Street_Joiner.Address, tbl_Street_Joiner.Joiner_Title_ID,
tbl_Street_Joiner.StreetNameID, tbl_Street_Joiner.OrderSeq,
tbl_Street_Joiner.Street_Name_Joins_ID, tbl_Street_Joiner.Junction
FROM tbl_Street_Joiner
ORDER BY tbl_Street_Joiner.OrderSeq;

This is my duplicate records SQL:

SELECT tbl_Street_Joiner.Address, tbl_Street_Joiner.Street_Name_Joins_ID,
tbl_Street_Joiner.Joiner_Title_ID, tbl_Street_Joiner.StreetNameID,
tbl_Street_Joiner.Junction
FROM tbl_Street_Joiner
WHERE (((tbl_Street_Joiner.Address) In (SELECT [Address] FROM
[tbl_Street_Joiner] As Tmp GROUP BY [Address] HAVING Count(*)>1 )) AND
((tbl_Street_Joiner.Junction) Is Null))
ORDER BY tbl_Street_Joiner.Address;

The main address form is: 'frm_Street_Joiner_Main'

The duplicates form is: frm_Street_Joiner_duplicates
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top