67flyer
Registered User.
- Local time
- Yesterday, 19:23
- Joined
- Jul 29, 2006
- Messages
- 49
I am trying to add another record to a table. Pid and nsn are the keys. the table has 70 unique pid's. I need to add another nsn to each of the pid's. I tried the following code but no go:
Set db = CurrentDb
Set rst1 = db.OpenRecordset("tblHandReceipt")
Set rst2 = db.OpenRecordset("tblHandReceipt")
rst1.MoveFirst
Do Until rst1.EOF
rst2.AddNew
rst2!PID = rst1!PID
rst2!NSN = Forms!frmparts!NSN
rst2!ISSUEDSOURCE = Forms!frmparts!subfrmEndItemParts.Form!cbxENDITEM
'Add like above line for each field
rst2.Update
rst2.MoveNext
rst1.MoveNext
Loop
rst1.Close
rst2.Close
Thanks for any help.
Set db = CurrentDb
Set rst1 = db.OpenRecordset("tblHandReceipt")
Set rst2 = db.OpenRecordset("tblHandReceipt")
rst1.MoveFirst
Do Until rst1.EOF
rst2.AddNew
rst2!PID = rst1!PID
rst2!NSN = Forms!frmparts!NSN
rst2!ISSUEDSOURCE = Forms!frmparts!subfrmEndItemParts.Form!cbxENDITEM
'Add like above line for each field
rst2.Update
rst2.MoveNext
rst1.MoveNext
Loop
rst1.Close
rst2.Close
Thanks for any help.