Thanks jon, will certainly take a look at that.
I have however a new problem with this sql string that you have helped me create. It works marvellously but I have gotten stuck on a relatively minor issue.
briefly , till now when a user deleted a record , it was not really deleted, rather it caused a string ("deleted" & Date()) to be entered into a field . that way all the queries were told to find records which match criteria as long as deleted* was not in that specific field (WHERE [fieldname] not LIKE deleted* OR is null) This allowed the user to enter deleted* into the "any" (on all fields) search which would pick up deleted entries and worked wonderfully.
However now that we have combined the search criteria and the any search into one sql, I am stuck.
I don't want the user to pick up deleted records when doing a normal search for text in particular fields but I still want them to be able to type deleted* into the any textbox and the deleted records should be allowed thru. This however is a contradiction in the where clause. Either I am instructing thatthe deleted records should be blocked , on the other hand I want to be able to pick them up in the any search textbox
Here is my current sql
SELECT [tblBook].[lngBookNo] AS Valmadonna, [tblBook].[strBookName] AS BookName, [tblBook].[strBookNameHebMapped] AS [Hebrew Name], [tblBook].[strDateInNums] AS PrintDate, [tblBook].[strAuthor] AS author, [tblPrinter].[strPrinter] AS Printer, [tblType].[strType] AS Type, [tblBook].[dateStamp], [tblBook].[strDateHebMapped] AS hebdate, [tblBook].[strBibliography], [tblBook].[strNotes], [tblBook].[strSizeMapped], [tblBook].[mmoInfo], [tblCity].[strCity] AS city, [tblBook].[strDatAcronymMapped]
FROM tblCity INNER JOIN (tblType INNER JOIN (tblPrinter INNER JOIN tblBook ON [tblPrinter].[ID]=[tblBook].[tblPrinter_ID]) ON [tblType].[ID]=[tblBook].[tblType_ID]) ON [tblCity].[ID]=[tblBook].[tblCity_ID]
WHERE (((IIf(IsNull([forms]![frmbook]![txtandauthor]),True,[tblbook].[strauthor] Like [forms]![frmbook]![txtandauthor]))<>False) And ((IIf(IsNull([forms]![frmbook]![txtandtitle]),True,[tblbook].[strbookname] Like [forms]![frmbook]![txtandtitle]))<>False) And ((IIf(IsNull([forms]![frmbook]![txtandval]),True,[tblbook].[lngbookno] Like [forms]![frmbook]![txtandval]))<>False) And ((IIf(IsNull([forms]![frmbook]![txtandprinter]),True,[tblprinter].[strprinter] Like [forms]![frmbook]![txtandprinter]))<>False) And ((IIf(IsNull([forms]![frmbook]![txtandcity]),True,[tblcity].[strcity] Like [forms]![frmbook]![txtandcity]))<>False) And ((IIf(IsNull([forms]![frmbook]![txtandDate]),True,[tblbook].[strDate] Like [forms]![frmbook]![txtandcity]))<>False) And ((IIf(IsNull([forms]![frmbook]![txtandType]),True,[tbltype].[strType] Like [forms]![frmbook]![txtandType]))<>False) And ((IIf(IsNull([Forms]![frmBook]![txtAndAny]),True,(([tblbook].[lngbookno] Like ([Forms]![frmBook]![txtAnd Any])) Or ([tblbook].[strbookname] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblPrinter].[strprinter] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblcity].[strcity] Like ([Forms]![frmBook]![txtAndAny])) Or ([tbltype].[strtype] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[mmoInfo] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[lngbookid] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[mmoaddnotes] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[strbibliography] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[strnotes] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[strsizemapped] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[datestamp] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[strauthor] Like ([Forms]![frmBook]![txtAndAny])) Or ([tblbook].[strdate] Like ([Forms]![frmBook]![txtAndany])))))<>False))
ORDER BY [tblbook].[lngbookno];
By the way each time I switch to design view and do an adjustment it tells me that there is a syntax error but if I adjust in sql view it will save it fine and work OK
can you spot any obvious errors in this forest?
Thanks again for all your terrific help