Can I exclude the criteria Value from the query results?

E

efandango

I am using the [Dupe_Joiner_Title_ID] to match a list of records from a
duplicates table against an ID form field, but want to exclude the actual
value that the query uses as the criteria from being seen in the continous
form that is linked to the query, but shows all other matching records for
the form's current record.

This is the criteria code:
[Forms]![frm_Runs]![frm_Street_Joiner_Main].[Form]![frm_Street_Joiner_Sub].[Form]![Joiner_Title_ID]
that is in the 'Dupe_Joiner_Title_ID: Joiner_Title_ID' column.

This is my SQL:

SELECT Tbl_Street_Joiner_Dupes.Address,
Tbl_Street_Joiner_Dupes.Street_Name_Joins_ID,
Tbl_Street_Joiner_Dupes.StreetNameID, Tbl_Street_Joiner_Dupes.Junction,
tbl_Street_Joiner.Joiner_Title_ID, Tbl_Street_Joiner_Dupes.Joiner_Title_ID AS
Dupe_Joiner_Title_ID
FROM tbl_Street_Joiner INNER JOIN Tbl_Street_Joiner_Dupes ON
tbl_Street_Joiner.StreetNameID = Tbl_Street_Joiner_Dupes.StreetNameID
WHERE
(((Tbl_Street_Joiner_Dupes.Joiner_Title_ID)=[Forms]![frm_Runs]![frm_Street_Joiner_Main].[Form]![frm_Street_Joiner_Sub].[Form]![Joiner_Title_ID]));
 
K

Ken Snell \(MVP\)

Remove that field from the query's output field list:

SELECT Tbl_Street_Joiner_Dupes.Address,
Tbl_Street_Joiner_Dupes.Street_Name_Joins_ID,
Tbl_Street_Joiner_Dupes.StreetNameID, Tbl_Street_Joiner_Dupes.Junction
FROM tbl_Street_Joiner INNER JOIN Tbl_Street_Joiner_Dupes ON
tbl_Street_Joiner.StreetNameID = Tbl_Street_Joiner_Dupes.StreetNameID
WHERE
(((Tbl_Street_Joiner_Dupes.Joiner_Title_ID)=[Forms]![frm_Runs]![frm_Street_Joiner_Main].[Form]![frm_Street_Joiner_Sub].[Form]![Joiner_Title_ID]));
 

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