Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I break down the summed numbers

Status
Not open for further replies.

itsgoodtobeking

Programmer
Jun 5, 2003
54
0
0
US
I have a table that gives me the sum of a number of parts to run. I need to break down that summed number into individual numbers to make serialized labels for the parts. I think I need to make a new table with each part to run as a different row.So each row contains a number of one to run. But I still will need to break down the summed numbers. Can anyone tell me how to do this??
 
I'm not at all clear about what you mean by "... break down the summed numbers ..." Arithemetically speaking, if the sum is 4 for example, then obviously there is no one "breakdown" (1+1+1+1, 2+2, 1+3) that is preferred over any other. Can you provide an example?
 
If I have a quantity of four in a row, I need to get four different rows with the quantity of one in each.
 
Let's try some pseudo code to be sure that we are on the same wavelength.

I assume you are looping through a recordset to print labels and the code looks something like this

Do Until rs.EOF

' Code to Print a Label

rs.MoveNext
Loop

If the Recordset contains the Sum (earlier discussion) then you probably just need to change this to:

Do Until rs.EOF
For n = 1 To rs![SumField]
' Code to Print a Label
Next n
rs.MoveNext
Loop

Are on the same page? (or even in the same book?)
 
Thanks for your response, I will try to modify the code to step through the summed numbers. I will follow up with this with the results of this.
 
I have tried this, the only problem is that is goes through the whole table at once and only will increment on the first row in the table. Then will go through the whole table again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top