Hi everyone
I have a form that has search options on it. One in particular involves three text areas where you can enter words (one word in each) to search a table for. I used three OR statements in the SELECT portion of my query SQL for each field that I'm searching through.
It works fine if the user enters a word in each text box then hits the query macro (in other words, it searches the table for any entry that has one of the three inputted words). Problem is, when any of the boxes are left BLANK, the query returns ALL entries.
I've tried altering the default value for the text boxes, but I still want the boxes to appear blank. I want it so that, in essence, if you leave two boxes blank, it means that you only want to search for one word.
I wondering if it is because there is one field in my table that has no data, and I assume set to the default "Null". But there should still be a way.
Any help that any of you kind people out there may be able to offer would be greatly appreciated.
Thanks
Mike
I have a form that has search options on it. One in particular involves three text areas where you can enter words (one word in each) to search a table for. I used three OR statements in the SELECT portion of my query SQL for each field that I'm searching through.
It works fine if the user enters a word in each text box then hits the query macro (in other words, it searches the table for any entry that has one of the three inputted words). Problem is, when any of the boxes are left BLANK, the query returns ALL entries.
I've tried altering the default value for the text boxes, but I still want the boxes to appear blank. I want it so that, in essence, if you leave two boxes blank, it means that you only want to search for one word.
I wondering if it is because there is one field in my table that has no data, and I assume set to the default "Null". But there should still be a way.
Any help that any of you kind people out there may be able to offer would be greatly appreciated.
Thanks
Mike