Question combining quantities of rows w/ same data

supertekk

New member
Joined
Jan 8, 2010
Messages
1
Programming Experience
1-3
A little background of my situation!!


I have an application written in vb 2005.
It gets data about two Product Types from a csv file.
If it is a bookshelf it is inserted into table 1. If it is a bookshelf case --> Table 2.
This information is used to tell a person how to make the bookshelf in a factory setting. That part works perfectly fine.

Now for each separate table... my columns are quantity, width, height, depth, ProdType, and ProdStyle.

The program then compares RowA with RowB... If the prodstyle of rowA = RowB and the height, width, depth of both rows are equal it needs to combine the quantity.

My process has a hiccup in it, which goes as follows.
I compare my 4 columns in rowA with the same columns in RowB.
If this statement is true I add the quantity from RowB to RowA. Using an update statement in access.
Update BookshelfsOnly set Quantity = 'NewQuan' where Name = "Style1" and Width = 'width1' and height = 'height1' and RowNum = 'RowNumA'
Then I delete RowB
The before I restart my loop, I requery my table to get a new count of rows.
That part updates what number my loop runs to.

So my problem is...

After my process is finished. I query my table to display in a datagrid, which works fine, I still have rows that should have been combined. I dont know what I am doing wrong in my process.
 
Back
Top