My Code:
strSQL = "INSERT INTO OldAccounts SELECT * FROM ActiveAccounts WHERE ID = " & MyID & " "
DoCmd.RunSQL strSQL
strSQL = "DELETE FROM ActiveAccounts WHERE ID = " & MyID & " "
DoCmd.RunSQL strSQL
Where MyID is auto number from ActiveAccounts. When I run this line, if the in the OldAccounts is the same as MyID ( the ID that is being inserted ) it doesn't insert into OldAccounts . This code only insert record with ID from ActiveAccounts that OldAccounts doesn't have. How can I successfully move a record from ActiveAccounts to OldAccounts despite having same ID? Basically I want to Append a record from ActiveAccounts into OldAccounts.
strSQL = "INSERT INTO OldAccounts SELECT * FROM ActiveAccounts WHERE ID = " & MyID & " "
DoCmd.RunSQL strSQL
strSQL = "DELETE FROM ActiveAccounts WHERE ID = " & MyID & " "
DoCmd.RunSQL strSQL
Where MyID is auto number from ActiveAccounts. When I run this line, if the in the OldAccounts is the same as MyID ( the ID that is being inserted ) it doesn't insert into OldAccounts . This code only insert record with ID from ActiveAccounts that OldAccounts doesn't have. How can I successfully move a record from ActiveAccounts to OldAccounts despite having same ID? Basically I want to Append a record from ActiveAccounts into OldAccounts.