RosyGlasses
Programmer
Hello, I have a form with two number fields. Sample and Extra.
A query is run against a main table with thousands of rows and returns Sample+Extra records randomly. Ex: If 100 is entered into Sample and 25 in Extra, then 125 records are randomly returned. There is no differentiation in the results between Sample and Extra.
Is there a way to flag the records returned with the first 100 as 'S' and the next 25 as 'E'? It doesn't matter which records get flagged S or E, as long as 100 are S and 25 are E. However, these numbers change depending on what the user enters in the form so any calculation would have to refer to the form fields.
I'm on a convoluted path right now of separate append queries sorted first ascending, then descending, using Top 100/Top 25 variables in strSQL (VBA code) and ending up with a final table. I think I can get it to work but I'm wondering if I'm missing something obvious and cleaner.
Thank you for any insight.
A query is run against a main table with thousands of rows and returns Sample+Extra records randomly. Ex: If 100 is entered into Sample and 25 in Extra, then 125 records are randomly returned. There is no differentiation in the results between Sample and Extra.
Is there a way to flag the records returned with the first 100 as 'S' and the next 25 as 'E'? It doesn't matter which records get flagged S or E, as long as 100 are S and 25 are E. However, these numbers change depending on what the user enters in the form so any calculation would have to refer to the form fields.
I'm on a convoluted path right now of separate append queries sorted first ascending, then descending, using Top 100/Top 25 variables in strSQL (VBA code) and ending up with a final table. I think I can get it to work but I'm wondering if I'm missing something obvious and cleaner.
Thank you for any insight.