Counting Up Until Number Changes-With New Condition

chaddiesel

Registered User.
Local time
Today, 03:32
Joined
Mar 30, 2005
Messages
24
I appreciate the help on this board. I want to assign a number to each record that will be part of a shipping number. I want the number value to count up until the contract number changes. Then, I want the number to go back to 1 and start counting up again until the next contract change.

Jon K on the board gave me this query suggestion:

DCount("*","Label_Info","[Contract_Number]='" & [Contract_Number] & "' And [Ship_Table]![RecordID] <=" & [Ship_Table]![RecordID])+0

This worked great. My new problem is I have to add another field called Packed_With to cover parts that are packed in other boxes. The Packed_With value is going to be C or W (Contains or With). Most of my records will not contain either C or W, but if I pick C, then the next record will be W. I want the W record to have the same value as the previous. I might have yet another W value next if there is more than 1 part. So, I want all the W's to have the same number value as the C, and I want to start counting where I left off after the W. I know I am not explaining myself well, so here is another example:

For example

Contract 1111111 Box 1 of 2 Number Value: 1
Contract 1111111 Box 2 of 2 Number Value: 2
Contract 1111111 Skid 1 of 1 Number value: 3
Contract 1111111 Box 1 of 1 C Number Value: 4
Contract 1111111 W Number Value: 4
Contract 1111111 W Number Value: 4
Contract 1111111 W Number Value: 4
Contract 1111111 Skid 1 of 1 Number Value: 5
Contract 1111111 Box 1 of 1 Number Value: 6

Contract 2222222 Box 1 of 2 Number value: 1
Contract 2222222 Box 2 of 2 Number value: 2
Contract 2222222 Skid 1 of 1 Number value: 3
Contract 2222222 Bundle 1 of 2 Number value: 4
Contract 2222222 Bundle 2 of 2 Number value: 5


Is there a way to modify the DCount method to do what I want?

I would really appreciate the help. I'm trying to learn as I go. I'm new to access in case you can't tell.

Chad
 

Users who are viewing this thread

Back
Top Bottom