Michael, All,
I've now got two tables working great using INNER JOIN. I did
have to make some minor tweeks to the example above which I believe is
because of the MS JET connector. The problem now is getting the
syntax right for using more than two tables. There is a lot of
code examples for using two tables but I can't find much reference to
using more, except for several other people asking how to do it
For two tables to work I've used:
searchStr = "SELECT tbl1.f1, tbl1.f2,..., tbl2.f1, tbl2.f2,... FROM
tbl1 INNER JOIN tbl2 ON tbl1.id = tbl2.id WHERE tbl1.id > 0 "
I inserted the WHERE (which selects all records in the primary table
which is fine) so that the AND located in the IF loops follow
correctly. This all works well and I get the correct data
returned from searches.
I've tried several variations of adding a third table but continue
getting "Syntax error (missing operator) in query expression"
returned. The example above appears to refer to how multiple
layer tables are joined - my 7 tables are only 1 level deep from the
primary tbl1 - a 1 layer star.
So, do I join each of the 7 tables back to the primary table, e.g. 2
-> 1, 3 -> 1, 4 -> 1 etc, or do you cascade the join 1
-> 2, 2 -> 3, 3 -> 4, etc ?
Cheers,