This isn't a "how do I code it" so much as a "how do I go about it" kind of thing. I just need some more brains to help me wrap my head around what I'm going to be writing for the company i'm working for this summer.
Let's begin. What am I trying to do: Well, last summer, I wrote a company-wide database for Job Order sheets using Excel. I spent a few weeks writing the backend and building up a basic entry/saving system, but couldn't finish the search function due to school starting up again. Fast forward to now. They've asked me to complete the search function, but they have a very strict set of criteria that they want.
It must: Search for up to three things at the same time. Be able to perform multiple criteria searches using "And"s and "Or"s. Be quick. And the usual, you know, actually find stuff and return it.
In any case, I wrote the code for the userform yesterday. A nice fancy expanding solution that dazzled the bossman. The "and" and "or" options are radio buttons situated underneath the top and middle search field, so you can have Search1 AND Search2 Or Search3, and all the various combinations of one or the other.
Here's where I'm stuck. Without a giant "If" ladder, which is where I'm headed now, is there any easier way to do this? I jotted some psuedo-code down on a piece of paper, and I couldn't figure out a way around having redundant, duplicate code.
The issue is that I have multiple pathways that are going to be utilizing the same code. You can have one search term, which is easy, or you can have two search terms, which is either an addition to the first criteria or a separate case, but ultimately, you're executing the same block of code that you would with only one term.
Let's begin. What am I trying to do: Well, last summer, I wrote a company-wide database for Job Order sheets using Excel. I spent a few weeks writing the backend and building up a basic entry/saving system, but couldn't finish the search function due to school starting up again. Fast forward to now. They've asked me to complete the search function, but they have a very strict set of criteria that they want.
It must: Search for up to three things at the same time. Be able to perform multiple criteria searches using "And"s and "Or"s. Be quick. And the usual, you know, actually find stuff and return it.
In any case, I wrote the code for the userform yesterday. A nice fancy expanding solution that dazzled the bossman. The "and" and "or" options are radio buttons situated underneath the top and middle search field, so you can have Search1 AND Search2 Or Search3, and all the various combinations of one or the other.
Here's where I'm stuck. Without a giant "If" ladder, which is where I'm headed now, is there any easier way to do this? I jotted some psuedo-code down on a piece of paper, and I couldn't figure out a way around having redundant, duplicate code.
The issue is that I have multiple pathways that are going to be utilizing the same code. You can have one search term, which is easy, or you can have two search terms, which is either an addition to the first criteria or a separate case, but ultimately, you're executing the same block of code that you would with only one term.