George10988
Registered User.
- Local time
- Yesterday, 19:18
- Joined
- Apr 23, 2011
- Messages
- 41
Hello I am trying to connect a database search form to a query I made. I have put in some code in the criteria sections of the fields that I want to search. Of course these fields are referenced to their respective text boxes and submit button. It works perfectly unless one of the fields with in the table that the query looks in is null. Here is the code I am using
Like (IIf(IsNull([Forms]![frmDatabaseSearch]![txtFather]),"*",[Forms]![frmDatabaseSearch]![txtFather]))
If the data entry person wants to search for a female named mary but leaves the father txt box blank and clicks search, my query will not show any results, not even the girl's name "mary." I figured out that the reason this was happening was because Mary has no father listed in her record. As soon as I added a father to her record whala! my query pulled her record out. I want my query to return all results if text boxes are left blank even if those respective fields on the table are blank also. Is there any way to do this?
Like (IIf(IsNull([Forms]![frmDatabaseSearch]![txtFather]),"*",[Forms]![frmDatabaseSearch]![txtFather]))
If the data entry person wants to search for a female named mary but leaves the father txt box blank and clicks search, my query will not show any results, not even the girl's name "mary." I figured out that the reason this was happening was because Mary has no father listed in her record. As soon as I added a father to her record whala! my query pulled her record out. I want my query to return all results if text boxes are left blank even if those respective fields on the table are blank also. Is there any way to do this?