I would like to append the current record on a form to a different table on click event.
Writing my sql statement, I am advised that INSERT INTO isn't valid.
What is wrong with this code?
Thanks.
Writing my sql statement, I am advised that INSERT INTO isn't valid.
What is wrong with this code?
Thanks.
Code:
Private Sub Append_Click()
Dim strSQL As String
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
If Me.Dirty Then Me.Dirty = False 'force record to be saved
strSQL = 'INSERT INTO tblRunsheet ( InstrID, Link, Location, Description, Instrument," _&
"Dated, Filed, Grantor, Grantee, Comments, Comments, Exclude, Tract, Copy, Include )" _&
"SELECT" & me.InstrID, me.[$Link], me.[$DOC#], me.[$DOCRM], me.[$DOCTYP], me.[$FILEDT], me.[$FILEDT], me.[$P1], me.[$P2], me.Comments, me.Notes, me.Exclude, me.Tract, me.Copy, me.Include
"FROM" tbl_db1;
Set rs = Nothing
CurrentDb.Execute (strSQL), dbFailOnError
End Sub