One way to do it would be to copy the current record with Crrl-C or in the Edit Menu, select Copy. Then in the Edit Menu, select Paste Append. Then change your PK and save the record.
In code, you could do:
Dim rs as recordset
Set rs = currentdb().OpenRecordset(“Select * From table Where PK = ” & Me![PK]) ‘get the current record on the form
DoCmd.GoToRecord , , acNewRec ‘go to a new record on the form
If Not rs.EOF Then
Me![field1] = rs![field1]
Me![field2] = rs![field2]
etc…
rs.Close ‘now the new record is ready for the PK to be changed and saved
End If
Discuss This Question: