I have 2 drop down boxes on a form to identify criteria for the report. What I want is, if the user leaves the drop down blank, I want it to return all results. I tried the <All> option suggested in a FAQ however this does not work with the records that have this particular field blank. I need it to return all records including blanks OR the criteria selected from the drop down. Here is my query
SELECT tblClients.PartnerID, tblClients.Type, tblClients.CompanyName, [FirstName] & " " & [LastName] AS Name, tblContactLog.ContactDate, tblContactLog.PartnerID, tblClientContactDetails.PhoneWk
FROM (tblClients INNER JOIN tblContactLog ON tblClients.ClientID = tblContactLog.ClientID) INNER JOIN tblClientContactDetails ON tblClients.ClientID = tblClientContactDetails.ClientID
WHERE (((tblClients.PartnerID) Like [Forms]![frmReportCriteria]![Combo0]) AND ((tblClients.Type)=[Forms]![frmReportCriteria]![Combo2]) AND ((tblContactLog.ContactDate) Between [Forms]![frmReportCriteria]![Text4] And [Forms]![frmReportCriteria]![Text6]));
If the combos are left blank this comes up blank.
Thanks
SELECT tblClients.PartnerID, tblClients.Type, tblClients.CompanyName, [FirstName] & " " & [LastName] AS Name, tblContactLog.ContactDate, tblContactLog.PartnerID, tblClientContactDetails.PhoneWk
FROM (tblClients INNER JOIN tblContactLog ON tblClients.ClientID = tblContactLog.ClientID) INNER JOIN tblClientContactDetails ON tblClients.ClientID = tblClientContactDetails.ClientID
WHERE (((tblClients.PartnerID) Like [Forms]![frmReportCriteria]![Combo0]) AND ((tblClients.Type)=[Forms]![frmReportCriteria]![Combo2]) AND ((tblContactLog.ContactDate) Between [Forms]![frmReportCriteria]![Text4] And [Forms]![frmReportCriteria]![Text6]));
If the combos are left blank this comes up blank.
Thanks