I want to run an Insert query to insert records from one database into a different database using VBA code in Access 2007. I have set each database using the names WorkingDB as the source database and ActiveDB as the target database. The SQL is something like this:
strSQL4 = "INSERT INTO content ( contentid, contentname ) IN " & ActiveDB & "SELECT content.contentid, content.contentname FROM content, tblLkpSaveUpdatedDate IN” WorkingDB & “WHERE [tblLkpSaveUpdatedDate]![TimeUpdated] < [content]![createDate]"
Unfortunately, this doesn’t work. When I try to compile the code I get an error on the “ActiveDB” that says it is a type mismatch.
Is it possible to run this kind of query from code? If so, how can I do it?
Thanks.
strSQL4 = "INSERT INTO content ( contentid, contentname ) IN " & ActiveDB & "SELECT content.contentid, content.contentname FROM content, tblLkpSaveUpdatedDate IN” WorkingDB & “WHERE [tblLkpSaveUpdatedDate]![TimeUpdated] < [content]![createDate]"
Unfortunately, this doesn’t work. When I try to compile the code I get an error on the “ActiveDB” that says it is a type mismatch.
Is it possible to run this kind of query from code? If so, how can I do it?
Thanks.