access form button to copy record to another table

J

JMageeirbc

I would like to use one form button to copy a record to another table
and then delete it from the current table. Is this possible?
 
L

Lance

This function will append fields F1, F2 from the current form into fields F1
and F2 in Table1.. and then delete the current record.

sub append_and_delete
Dim sql_string As String
sql_string = "INSERT INTO Table1 ( F1, F2 ) SELECT '" &
Me.Recordset.Fields("F1").Value & "','" & Me.Recordset.Fields("F2").Value &
"'"
Call DoCmd.RunSQL(sql_string)
Me.Recordset.Delete
end sub

enjoy
 
Top