I thought this would be simple but I cant seem to find a satisfactory way of doing it.
Basically I have a form that has a drop down name selector. Once you select a name, a list box is populated with test results. You then select a test result.
A query is run populating a subform giving the matching test results(matching the unique test code), which are basically test results of 47 different elements tested.
So far so good, but now I need to parse through the results getting out information and this is where ive hit a snag.
The best example is that there are 24 toxic elements and I need to get all the ones that test greater than one. I need to save the element names in a string to txt control of those >1 and ideally be able to identify those elements later in different combinations.
The trouble im having is that the query builder can easily 'AND' things together but only a few will be >1 so as soon as one fails the query fails. Its seems that you can only 'OR' maxium of 6 things together, which would mean 4 different queries just to parse the 24 toxic elements.
I had thought that looping through the query in code and storing results in a txt array might be the way to go. But I dont have the knowledge to do that to a query. I have found some references to doing it by using currentDb and record sources loaded with the query but am not sure how to code it.
The only similiar thing ive done that might achieve the end result is create with tags an array of controls to loop through, test with if or case and store results in array. I did this with tick boxes once so you could select many different items and an array of your choices for that record was stored. It seems a very adhoc way of ahcieving it though. But I guess it could be done with the sub form query results. I was hoping there was a better more direct way to loop through the query results directly and pull out what I need, instead of populating controls and manipulating the data afterwards, which seems fraught with danger for data security and accurracy.
Can anybody help me with the code? or point me in the right direction with it or tell me how I might achieve it with queries or have any other ways of doing it.
The form and query I use so far has this structure:
-drop down text box **select name**
-txt box binds cust code which is used to populate list box with test results
-select list box test result
-Subform is populated with matching testcode and results
[testcode]1234, [Elemnt1]0.8, [Elemnt2]1.2, [Elemnt3]0.6, [Elemnt4]1.3.......[Elemnt24]0.12 etc
Results needed:
string of element names that test >1
[unbound_control]="[Elemnt2],[Elemnt4].....etc"
? perhaps txt array containing element names so can parse through for different combinations for later analysis.
Basically I have a form that has a drop down name selector. Once you select a name, a list box is populated with test results. You then select a test result.
A query is run populating a subform giving the matching test results(matching the unique test code), which are basically test results of 47 different elements tested.
So far so good, but now I need to parse through the results getting out information and this is where ive hit a snag.
The best example is that there are 24 toxic elements and I need to get all the ones that test greater than one. I need to save the element names in a string to txt control of those >1 and ideally be able to identify those elements later in different combinations.
The trouble im having is that the query builder can easily 'AND' things together but only a few will be >1 so as soon as one fails the query fails. Its seems that you can only 'OR' maxium of 6 things together, which would mean 4 different queries just to parse the 24 toxic elements.
I had thought that looping through the query in code and storing results in a txt array might be the way to go. But I dont have the knowledge to do that to a query. I have found some references to doing it by using currentDb and record sources loaded with the query but am not sure how to code it.
The only similiar thing ive done that might achieve the end result is create with tags an array of controls to loop through, test with if or case and store results in array. I did this with tick boxes once so you could select many different items and an array of your choices for that record was stored. It seems a very adhoc way of ahcieving it though. But I guess it could be done with the sub form query results. I was hoping there was a better more direct way to loop through the query results directly and pull out what I need, instead of populating controls and manipulating the data afterwards, which seems fraught with danger for data security and accurracy.
Can anybody help me with the code? or point me in the right direction with it or tell me how I might achieve it with queries or have any other ways of doing it.
The form and query I use so far has this structure:
-drop down text box **select name**
-txt box binds cust code which is used to populate list box with test results
-select list box test result
-Subform is populated with matching testcode and results
[testcode]1234, [Elemnt1]0.8, [Elemnt2]1.2, [Elemnt3]0.6, [Elemnt4]1.3.......[Elemnt24]0.12 etc
Results needed:
string of element names that test >1
[unbound_control]="[Elemnt2],[Elemnt4].....etc"
? perhaps txt array containing element names so can parse through for different combinations for later analysis.