accessjack
Programmer
To append new records from tblOne to tblTwo, I use an action append query to add records where the id field in tblOne does not exist in tblTwo. I am trying to do this using vba rather than an action query. Below is my code. The code compiles and executes but 0 records are appended (no error messages). I can't figure out why. tblTwo has no records in it so I would expect all records from tblOne to be appended to tblTwo. Can anyone figure out why this is not working?
sql01 = "INSERT INTO [tblTwo]([Id]) " & _
"SELECT [tblOne].[Id] " & _
"FROM [tblOne] " & _
"LEFT JOIN [tblTwo] " & _
"ON [tblOne].[Id] = [tblTwo].[Id] " & _
"WHERE [tblTwo].[Id] = " & "'" & Null & "'"
Thanks,
AccessJack
sql01 = "INSERT INTO [tblTwo]([Id]) " & _
"SELECT [tblOne].[Id] " & _
"FROM [tblOne] " & _
"LEFT JOIN [tblTwo] " & _
"ON [tblOne].[Id] = [tblTwo].[Id] " & _
"WHERE [tblTwo].[Id] = " & "'" & Null & "'"
Thanks,
AccessJack