bhunley
04-30-2007, 07:58 AM
Okay so I have a database used for quality control. It has a main form where a part number is either entered or looked up. When a part number is entered into the "Part Number" field a subform runs a query and shows all instances for that part number in table "Main". Then a second subform references the same query to pull the total number of entries and number of rejected items into textboxes using the expression below.
Ex: =DCount("[PART NUMBER]","InspCount","[PART NUMBER]")
Located in the Control Source
Now I need to find a way to only count the number of records since the last rejected one. For example: If I have the following data:
Prt# Acc Rej
1234 100 000
1234 300 000
1234 010 090
1234 200 000
1234 000 200
I currently get "4" total and "1" rejected, but I also need to get "2" since last rejection. Bsaically, I need to count the number of 0's till I hit a number. The numbers display in textboxes and the words are just labels.
Sorry, I cannot post a sample db due to confidentiality reasons. Thanks in advance for your help. Oh, and this being my 5th day playing with VBA in Access, a simplified answer would be appreciated. I did not build this database, I was just asked to modify it. Thank you.
Ex: =DCount("[PART NUMBER]","InspCount","[PART NUMBER]")
Located in the Control Source
Now I need to find a way to only count the number of records since the last rejected one. For example: If I have the following data:
Prt# Acc Rej
1234 100 000
1234 300 000
1234 010 090
1234 200 000
1234 000 200
I currently get "4" total and "1" rejected, but I also need to get "2" since last rejection. Bsaically, I need to count the number of 0's till I hit a number. The numbers display in textboxes and the words are just labels.
Sorry, I cannot post a sample db due to confidentiality reasons. Thanks in advance for your help. Oh, and this being my 5th day playing with VBA in Access, a simplified answer would be appreciated. I did not build this database, I was just asked to modify it. Thank you.