What do you expect from this line?

serialnotxt.Text = a + 1

That will go through all the records, substituting the value of the textbox each iteration so you will get only the last one. And since you are adding the "1", are those numbers? do you want to add to the quantity or expect to add a 1 to the string?

Your connect() sub may affect the rest of the procedure, I don't know.

Note: enclose your code in CODE tags, not QUOTE ones.