Building Search Criteria Notes

Building Search Criteria Notes

An up-to-date list of the video sets available:-

Advanced Search Form

Original question on access world forums which prompted me to create this set of videos:-

“Search Criteria”

SQL string from that original question just in case the original question is lost:-

SELECT tblMain.ClientID, tblMain.Surname, tblMain.Organization, tblMain.ProgramTitle, tblMain.City, tblMain.State, tblMain.Zip4, tblMain.Telephone
FROM tblMain
WHERE (((tblMain.Surname) Like “*” & [Forms]![frmJeffSearch]![txtSurname]) AND ((tblMain.Organization) Like “*” & [Forms]![frmJeffSearch]![txtOrganization] & “*”) AND ((tblMain.ProgramTitle) Like “*” & [Forms]![frmJeffSearch]![txtProgramTitle] & “*”) AND ((tblMain.City) Like “*” & [Forms]![frmJeffSearch]![txtCity] & “*”) AND ((tblMain.State) Like “*” & [forms]![frmJeffSearch]![cboState]) AND ((tblMain.Zip4) Like [Forms]![frmJeffSearch]![txtZip4] & “*”) AND ((tblMain.Telephone) Like “(” & [forms]![frmJeffSearch]![txtAreaCode] & “*”));


SELECT tblMain.ClientID, tblMain.Surname, tblMain.Organization, tblMain.ProgramTitle, tblMain.City, tblMain.State, tblMain.Zip4, tblMain.Telephone
FROM tblMain
WHERE (((tblMain.Surname) Like "*" & [Forms]![frmJeffSearch]![txtSurname]) AND ((tblMain.Organization) Like "*" & [Forms]![frmJeffSearch]![txtOrganization] & "*") AND ((tblMain.ProgramTitle) Like "*" & [Forms]![frmJeffSearch]![txtProgramTitle] & "*") AND ((tblMain.City) Like "*" & [Forms]![frmJeffSearch]![txtCity] & "*") AND ((tblMain.State) Like "*" & [forms]![frmJeffSearch]![cboState]) AND ((tblMain.Zip4) Like [Forms]![frmJeffSearch]![txtZip4] & "*") AND ((tblMain.Telephone) Like "(" & [forms]![frmJeffSearch]![txtAreaCode] & "*"));		

…         ..         ..            ..        ..          ..           ..     ..  ..         … 

… …