NOTE: This is my first attempt at building a Database in Access
I am trying to build a query to look through a single table and show results based on input from a form (text and combo boxes). When I set the criteria to link it to the search form field, if the value in the table being queried is empty, it will omit that record. I.E. fields being searched are Date, Location, Item, and Owner. If the "Date" field is empty on the table being queried, as soon as I add the Like "*" & [Forms]![LostandFound]![Search]![LSearchDate] criteria, any records that do not have a date specified are removed from the list of results.
Here is the SQL for the Query I set up:
SELECT [Lost Items].LostID, [Lost Items].[Date Lost], [Lost Items].[Location Lost], [Lost Items].[Item Lost], [Lost Items].[Owner Name]
FROM [Lost Items]
WHERE ((([Lost Items].[Date Lost]) Like "*" & [Forms]![LostandFound]![Search]![LSearchDate] & "*") AND (([Lost Items].[Location Lost]) Like "*" & [Forms]![LostandFound]![Search]![LSearchLoc] & "*") AND (([Lost Items].[Item Lost]) Like "*" & [Forms]![LostandFound]![Search]![LSearchItem] & "*") AND (([Lost Items].[Owner Name]) Like "*" & [Forms]![LostandFound]![Search]![LSearchOwner] & "*"))
ORDER BY [Lost Items].LostID;
What would I need to change/add in order for it to include records with one of the fields being searched being blank and the field on the search form is blank as well? As I am new to Access, explainations of why (in laymans terms) would be greatly appreciated
Thanks for your help.
P.S. I appologize if this question was answered in another post. All the posts I looked at didn't seem to quite answer this question for me.