djfeldspiff
Programmer
I have the following piece of code behind a command button within a sub. My goal is to examine a record from the OrderProduct table and, pending the value in the Card_Qty field, duplicate the record in the CCIN table based on the OrderProduct!Card_Qty value. The problems is I'm only getting the first record from the OrderProduct table to process but not all of the data. Any help/direction would be greatly appreciated.
Thanks!
DJF
Dim rstOPQ As Recordset
Dim rst As Recordset
Dim intCounter As Integer
Set rstOPQ = CurrentDb.OpenRecordset("OrderProduct"
Set rst = CurrentDb.OpenRecordset("CCIN"
For intCounter = 1 To rstOPQ!Card_Qty
rst.AddNew
rst![CUSTNO] = rstOPQ![CUSTNO]
rst![CARDCOMP] = rstOPQ![CARDCOMP]
rst![CARDNAME] = rstOPQ![CARDNAME]
rst![TOLLFREENO] = rstOPQ![TOLLFREENO]
rst![CARDAXNO] = rstOPQ![CARDAXNO]
rst.Update
Next
Thanks!
DJF
Dim rstOPQ As Recordset
Dim rst As Recordset
Dim intCounter As Integer
Set rstOPQ = CurrentDb.OpenRecordset("OrderProduct"
Set rst = CurrentDb.OpenRecordset("CCIN"
For intCounter = 1 To rstOPQ!Card_Qty
rst.AddNew
rst![CUSTNO] = rstOPQ![CUSTNO]
rst![CARDCOMP] = rstOPQ![CARDCOMP]
rst![CARDNAME] = rstOPQ![CARDNAME]
rst![TOLLFREENO] = rstOPQ![TOLLFREENO]
rst![CARDAXNO] = rstOPQ![CARDAXNO]
rst.Update
Next