I'm building an sql statement through code in visual basic for an ms access database. The statement is created as a user selects fields from various tables. It works fine for 2 tables, but once a third table is introduced I get the following error:
Run-time error '-2147217900 (80040e14)
Syntax error (missing operator) in query expression
Here is the code that it is executing when it happens:
SELECT Tbl_Members.MemberID, Tbl_Member_History.Initiated_Date, Tbl_Partner.Name FROM Tbl_Members Inner Join Tbl_Member_History ON (Tbl_Members.MemberID = Tbl_Member_History.MemberID) Inner Join Tbl_Partner ON (Tbl_Member_History.MemberID = Tbl_Partner.MemberID)
It does not matter what fields or tables, as soon as there is more than 2 tables selected it gives the error. Also, as far as syntax, I've tried with and without the parenthesis.
Can anyone tell me what is wrong? Thanks.