We have a UserForm where clients will search for items in an inventory based on multiple search fields. Depending on which data they supply (search criteria) the program will search for different data in the inventory. In other words:
Enter Search Criteria:
Serial #: 1234567
City: AUSTIN
Address: <not supplied>
Type: D.R.E.
Status: <not supplied>
Sector: 1B
Now, with this data, the program should search for the Serial #, City, Type, and Sector fields, but ignore the Address and Status fields. Likewise, should they leave out/fill in the other fields it would be nice to ignore/include that data in the search.
The problem is the logic. Is the best mechanism to use a bunch of boolean values to check whether the fields are empty or filled in or is there some other built-in means of doing this? It seems ridiculous to have a bunch of If-Then-Else statements cluttering up the code, but if that is the only way to do it, then it'll have to be done. The only other option that comes to mind is a Case statement, but that seems a little too cumbersome as well.
Has anyone run into this issue before?
----------------------------------------
If you are reading this, then you have read too far...
Enter Search Criteria:
Serial #: 1234567
City: AUSTIN
Address: <not supplied>
Type: D.R.E.
Status: <not supplied>
Sector: 1B
Now, with this data, the program should search for the Serial #, City, Type, and Sector fields, but ignore the Address and Status fields. Likewise, should they leave out/fill in the other fields it would be nice to ignore/include that data in the search.
The problem is the logic. Is the best mechanism to use a bunch of boolean values to check whether the fields are empty or filled in or is there some other built-in means of doing this? It seems ridiculous to have a bunch of If-Then-Else statements cluttering up the code, but if that is the only way to do it, then it'll have to be done. The only other option that comes to mind is a Case statement, but that seems a little too cumbersome as well.
Has anyone run into this issue before?
----------------------------------------
If you are reading this, then you have read too far...