I am trying to find the most optimized way to do this operation which runs an SQL statement in Access-VBA :
SQl = "UPDATE " _
& "MainTable As T1 " _
& "INNER JOIN TableOfLists As T2 " _
& "ON (T2.SecondList = T1.MultiValuedList.value) " _
& "Set [FOUND IN LISTS] = 'YES' "
DoCmd.RunSQL SQl
SQl = "UPDATE " _
& "MainTable As T1 " _
& "INNER JOIN TableOfLists As T2 " _
& "ON (T2.FirstList = T1.MultiValuedList.value) " _
& "Set [FOUND IN LISTS] = 'YES' "
DoCmd.RunSQL SQl
This code works, can be improved surely, but I didn't manage to find out how.
What I've tried so far and the results I got :
- Adding 2 INNER JOIN but I get a syntax error 3075
- Adding 2 conditions separated by an OR in the INNER JOIN condition but I get an error 3081 : can't join more than 1 table
- This was my previous solution using 2 SELECT statements but I got recommended to use JOIN instead
Any suggestions welcomed !