B
bbdobuddy
Hi
In response to someones request here is the SQL
SELECT DDM2.ID, DDM2.ItemNumber, DDM2.Sudocstem, ItemLister.Cataloging,
MarciveProfile.CatalogingRequested, DDM2.Format, DDM2.Title
FROM ((DDM2 LEFT JOIN ItemLister ON DDM2.ID = ItemLister.ID) LEFT JOIN
MarciveProfile ON DDM2.ID = MarciveProfile.ID) LEFT JOIN Superseded ON
DDM2.ID = Superseded.ID
WHERE
(((ItemLister.Cataloging)=[Forms]![frmAgencyCode&IL&SupersededList]![cmbILInput])
AND ((DDM2.AgencyCode)=[Forms]![frmAgencyCode&IL&SupersededList]![cmbAInput])
AND
((Superseded.ItemNumber)=IIf([Forms]![frmAgencyCode&IL&SupersededList]![cmbSuperInput]="No",([Superseded].[ItemNumber])
Is Null,([Superseded].[ItemNumber]) Is Not Null)));
Is there something wrong with the last part of the WHERE statement
I am trying to say if the combobox value is "No" then I want to check for
null fields otherwise I want to check for all non null fields
Any help would be great
In response to someones request here is the SQL
SELECT DDM2.ID, DDM2.ItemNumber, DDM2.Sudocstem, ItemLister.Cataloging,
MarciveProfile.CatalogingRequested, DDM2.Format, DDM2.Title
FROM ((DDM2 LEFT JOIN ItemLister ON DDM2.ID = ItemLister.ID) LEFT JOIN
MarciveProfile ON DDM2.ID = MarciveProfile.ID) LEFT JOIN Superseded ON
DDM2.ID = Superseded.ID
WHERE
(((ItemLister.Cataloging)=[Forms]![frmAgencyCode&IL&SupersededList]![cmbILInput])
AND ((DDM2.AgencyCode)=[Forms]![frmAgencyCode&IL&SupersededList]![cmbAInput])
AND
((Superseded.ItemNumber)=IIf([Forms]![frmAgencyCode&IL&SupersededList]![cmbSuperInput]="No",([Superseded].[ItemNumber])
Is Null,([Superseded].[ItemNumber]) Is Not Null)));
Is there something wrong with the last part of the WHERE statement
I am trying to say if the combobox value is "No" then I want to check for
null fields otherwise I want to check for all non null fields
Any help would be great