input field filtering 2 criteria, multiple times over (1 Viewer)

bobandthesunset

New member
Local time
Today, 02:34
Joined
Feb 12, 2018
Messages
2
In my example, I have an input form that will be used to drive a query. The purpose is to allow the user to enter a part in a category and it search to find if that entered part was originally installed when the machine was built, or possibly later it received it, or maybe it didn't receive the part at all.
As in my example, a person might have a motor cam that has been recalled, so the user would enter into the motor section the part #, the query would look to see if the part was on when built (motor beginning) or sometime after (motor ending).
Another example would be finding a motor that used a certain cam and a transmission that used a certain gear ratio. The user would enter the cam part # in the motor section and the transmission part# in the transmission section. Query would search (motor beginning), (motor ending), (transmission beginning), and (transmission ending) to find where both parts match in an entry.
Typically I would use the query "Or" option when using a single set of options, but in my situation, I have about 8 beginning/ending scenarios, so it would be difficult to use the query builder "Or" option.
The database was filtering well when I only had to look up 1 set of data per category (i.e. motor beginning and transmission beginning and ...). But I am having to add the motor ending, transmission ending, ... into the mix of things.
And the input field still needs to be 1 input field per category (i.e. motor, transmission, ... with no beginning/ending added to it) to keep it simple for users. However when I link the input form field to the motor beginning and the motor ending fields, it comes up blank because it isn't in both places(beginning and ending).
My other issue is that I do not know SQL, so I don't know what to do with any info supplied in this format. I wish I did know it, but I don't, sorry.
Maybe I'm overlooking something obvious. I'm hoping so. Please let me know to try. I may not be able to do all recommendations due to limitations of the database owner, but I am open to try. Thank you.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:34
Joined
Aug 30, 2003
Messages
36,123
It would probably help to know your table structure, or perhaps see a sample db with some test data.
 

bobandthesunset

New member
Local time
Today, 02:34
Joined
Feb 12, 2018
Messages
2
I finally figured it out finally after 3 days of trying various things. It probably isn't the best way of doing it, but it works.
I took each set (beginning/ending) and made it a stand alone query with the criteria using data from the input form. And I used the Or option in the criteria to allow the query to search in either of the sets (beginning or ending). And I included the table ID in each query.
Then when all the stand alone queries were made, I made the overall query that linked one-to-one using the table ID.
It takes a while for it to run thru all the queries to filter everything, but it gets the job done. Sorry I couldn't post the database, but the info is restricted by company's confidentially agreement. Hopefully this helps others out. And maybe this will help lead them to a better solution than what I've come up with.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:34
Joined
Aug 30, 2003
Messages
36,123
Glad you found a solution.
 

Users who are viewing this thread

Top Bottom