Hi Everyone,
I am trying to write some VBA code that will append records to a table, but this table has a composite key. My initial code looks like this:
The first RunSQL works great! However, the second produces an error message, saying that the action query won't append the record(s) due to a problem with keys. Can anyone see if there's something wrong with my code, or am I attempting to do something that is impossible to do in the first place?
Thanks!
~mforema
I am trying to write some VBA code that will append records to a table, but this table has a composite key. My initial code looks like this:
Code:
Dim mySQL1 as String DoCmd.RunSQL "INSERT INTO tblKeywords (Keyword) Values ('" & txtKeyword1.Value & "')" mySQL1 = "INSERT INTO tblArticleKeyword (ArticleID, Keyword)" mySQL1 = mySQL + " Values ('" & [Form_frmLiteratureArticles - edit].ArticleID.Value & "', " mySQL1 = mySQL + "'" & txtKeyword1.Value & "')" DoCmd.RunSQL mySQL1
Thanks!
~mforema
Comment