I am very new to Access and VBA/SQL. I am attempting to copy one record to another table on click event. I then want to delete it from the original record that I am copying from. But first I am having trouble with the insert into statement. The table is not a local table but I do have it as a linked table. This is the code I am using. Could someone please help me with where I am stuck? It is telling me Method or data member not found and highlighting the below. Any help would be appreciated. Thank you in advance.
Private Sub APPROVE_AfterUpdate()
Dim db As Database
Set db = OpenDatabase("ROs To Be Deleted")
Dim strSQL As String
' Create a new record in the ROSTOBEDELETED table.
strSQL = " INSERT INTO ROSTOBEDELETED ([SR CM], AdminName, ADMIN, Vendor, VID, RO, MPN, M&E, [Serial Number], ScrubCode, ScrubComments, [Sr Comments], APPROVE, DENY) " & "SELECT " & Me.[SR CM] & ", " & Me.AdminName & " , " & Me.ADMIN & ", " & Me.Vendor & ", " & Me.VID & ", " & Me.RO & ", " & Me.MPN & ", " & Me.[M&E] & ", " & Me.[Serial Number] & "," & Me.ScrubCode & "," & Me.ScrubComments & "," & Me.[Sr Comments] & ", " & Me.APPROVE & "," & Me.DENY & ";"
End Sub
Private Sub APPROVE_AfterUpdate()
Dim db As Database
Set db = OpenDatabase("ROs To Be Deleted")
Dim strSQL As String
' Create a new record in the ROSTOBEDELETED table.
strSQL = " INSERT INTO ROSTOBEDELETED ([SR CM], AdminName, ADMIN, Vendor, VID, RO, MPN, M&E, [Serial Number], ScrubCode, ScrubComments, [Sr Comments], APPROVE, DENY) " & "SELECT " & Me.[SR CM] & ", " & Me.AdminName & " , " & Me.ADMIN & ", " & Me.Vendor & ", " & Me.VID & ", " & Me.RO & ", " & Me.MPN & ", " & Me.[M&E] & ", " & Me.[Serial Number] & "," & Me.ScrubCode & "," & Me.ScrubComments & "," & Me.[Sr Comments] & ", " & Me.APPROVE & "," & Me.DENY & ";"
End Sub