I've been given a database to overhaul. Currently it uses the switchboard to run reports as follows;
Report by date range
Report by name
Report by permit number
Report by company
Report by class
I thought it would be pretty fancy to have just one form used to search by whatever criteria the user fills in using the following text/combo boxes;
Enter start date
Enter end date
Enter name ... etc.
This way the user could enter just a name on the form to see a report of all the classes (along with the other information) that someone has attended. Or they could enter a class to see all of the people who have taken the class. They could also narrow it down to see if a particular person had attended a particular class between a certain date range. If there is nothing in the textbox, the query would include all records.
So far I've built the form and entered the following criteria all on the And line of the query for each field;
Permit - [Forms]![frmSearchPermit]![UBPermit]
Issue Date - Between [Forms]![frmSearchPermit]![UBStart] And [Forms]! [frmSearchPermit]![UBEnd]
Name - [Forms]![frmSearchPermit]![UBName]
Class - [Forms]![frmSearchPermit]![UBClass]
I was getting an error message saying the expression is typed incorrectly or is too complex to be evaluated, but now I don't get any results at all. I'm sure the reason is probably because it is looking for null values in the fields where nothing is entered in the search boxes. How can I overcome this obstacle to get the form working to get results whether one box is entered or any combination of boxes are filled in?
Thanks for any help offered!