Hi and thanx for reading my post..
Underneat is the current SQL i'm trying to get to work (in Access 2000)
Cant get it to work, cause i'm getting Join errors..
-----------CODE--------------
strSQl = "SELECT p.PID, p.Lastname, p1.PID, p1.Lastname" & _
" FROM Person p, Person p1" & _
" INNER JOIN (PersonPerson pp ON pp.PID = p.PID OR pp.PID2 = p.PID)" & _
" WHERE (pp.PID LIKE '*" & CStr(Me.txtSearch) & "*'" & _
" OR pp.PID2 LIKE '*" & CStr(Me.txtSearch) & "*')"
----------END CODE-----------
-------------DESCRIPTION--------------------
1) Got a table "Person" where i'm inserting PID and Lastname.
2) Registering person 1-> PID = 1, Lastname = Doe
3) Registering person 2-> PID = 2, Lastname = John
4) Using table PersonPerson (manually) to connect these two together.
PID1 = 1, PID2 = 2
5) By using this i can use SQL to get the data from both persons taht are
connected
6) So basically, i want to go through all records in the personperson table, to find PID and PID2, and then use _both_ the fields to check against the Person-table. First getting Person.PID and Person.Lastname (For PERSON 1) THEN... do the exact same operation for PID2.
-------------END DESCRIPTION------------------
Result should look like this :
Person1 ID, Person1 Lastname, Person2 ID, Person2 Lastname
----------------------------------------------------------
1 Doe 2 John
Will be enormously happy if anyone could help me out with this code...
/(_Mirador
