Well, your code appears to be syntactically correct, but it's not clear what you want to achieve. What the code does is to add x records to the table, where x is the value of your txtQty control. All the records will contain the same data, that is, the value being displayed in the combo. Is that what you want?
Next, it is
useless to tell us that you "go an error".
You have to tell us what the error is. We need to know the actual message (or error code) and the line in your code that caused the error. I'm sure we've told you this before in other threads.
Off the top of my head, the only thing I can see that might cause an error is the fact that your txtQty might contain a text string rather than a numeric. If it does, that will cause a datatype mis-match error in the line beginning with FOR. To avoid that, you need to convert the string to a numeric, using VAL().
But that's really just a guess. Without more information, you're not going to get a definite answer.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads