Skip to content Skip to sidebar Skip to footer

Insert Into Sql Vba

I am trying to select records that are in the first table but not in the second table and insert them into the second table using a sql statement in VBA. I have started it below b

Solution 1:

First, you need supply field list to insert statement:

INSERTINTO Clients (ClientID)...

Second, your query doesn't insert any rows, because you check ClientID presence in same table. Did you mean someting like next:

"Where DD.[Client ID] NOT IN (SELECT DD2.[Client ID]FROM " & tableName2 & " as DD2)"

Post a Comment for "Insert Into Sql Vba"