Hi
I am having trouble with ms-access and trying to determind whether or
not a row already exisitng in a particular table.
I have 3 tables namly Projects, ProjectsAttence dByContact,
ContactDetails
Defined as below.
Projects ProjectsAttende dByContact ContactDetails
------------ -------------------------- ------------------
*ProjectID *ProjectID *RefrenceNumber
ProjectName *RefrenceNumber Name
ThisProjectYes/No AttendedYes/No Surname
etc. etc.
What I am trying to do is allow a contact to attend many projects.
I have a form which has the Refrence number on it. So when I move to
the next record on the form I'd like to check if the combination of
ProjectID and RefrenceNumber exists in the ProjectsAttende dByContact
table - and if not to insert this combination into the table.
(I should have noted that the field onthe Projects table called
ThisProjectYes/No denotes which onthe list of projects we are currently
dealing with)
The SQL that I have been working on looks like this::
SELECT 5 AS Expr1, Projects.Projec tID AS Projects_Projec tID,
Projects.Projec tName, Projects.ThisPr oject
FROM Projects
WHERE (((5) Not In (select RefrenceNumber from
ProjectsAttende dByContact)) AND ((Projects.Proj ectID)<>Exists (select
ProjectID from ProjectsAttende dByContact)) AND
((Projects.This Project)=Yes));
WHERE 5 would be the RefrenceNumber on the form
ANY HELP WITH THIS WOULD BE TRUELY APPRICIATED!!
Thanks in advance.
Melissa