One field not updating in Append Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Me again. Got my tables set up the *right* way and having a problem getting
the append query to update the EmployeeID field. Have the following:

INSERT INTO tblPersonnelCompetencies ( CompetencyID )
SELECT tblWardCompetencies.CompetencyID
FROM tblWardCompetencies, tblPersonnel
WHERE (((tblPersonnel.WardID)=[tblWardCompetencies].[WardID]));

I got all the relationships set up like mnature advised and it's A LOT
easier to add wards, competencies, select what competencies are required for
a ward, etc.

What I am trying to do with the above is as soon as I add a person and
assign them a ward in tblPersonnel, for it to automatically populate the
tblPersonnelCompetencies so that if the field is null or expired, I can let
them know. They way it works above right now is great (based on the
tblwardcompetencies it is giving the person the right mix of competencies),
but it is not taking tblPersonnel.EmployeeID and putting it in
tblPersonnelCompetencies.EmployeeID. Am I missing something obvious
(probably!)
Thanks!
 
Never mind. Figured it out. It WAS something simple. You gotta put the darn
EmployeeID field in there :)

INSERT INTO tblPersonnelCompetencies ( CompetencyID, EmployeeID )
SELECT tblWardCompetencies.CompetencyID, tblPersonnel.EmployeeID
FROM tblWardCompetencies, tblPersonnel
WHERE (((tblPersonnel.WardID)=[tblWardCompetencies].[WardID]));
 
Back
Top