M
Michelle
I have the following SQL code for a query that joins 3 tables so I could
enter data.
SELECT tblInmGangData.DOCNumber, inmtinfo.IN_NAME, tblInmGangData.NName,
tblInmGangData.Rank, inmtinfo.IN_OFFENSE, inmtinfo.IN_CMTCNTY,
inmtinfo.IN_SNTCLAS, inmtinfo.IN_EFFDATE, inmtinfo.IN_MINDATE,
inmtinfo.IN_MAXDATE, inmtinfo.IN_MINSNT, inmtinfo.IN_MAXSNT, inmtinfo.IN_WA1,
tblInmGangData.STGMisconducts, tblInmGangData.Comments, tblInmGangData.Photo,
tblInmGangData.Tattoo1, tblInmGangData.Tattoo2, tblInmGangData.Tattoo3,
tblInmGangData.Files, tblGang.GangName, [IN_BLDING] & "-" & [IN_SECTION] &
"-" & [IN_CELLDRM] & "-" & [IN_BEDNUM] AS BSCB, tblInmGangData.Inactive
FROM tblGang RIGHT JOIN (tblInmGangData INNER JOIN inmtinfo ON
tblInmGangData.DOCNumber = inmtinfo.IN_INMNUM) ON tblGang.GangID =
tblInmGangData.Affilation
WHERE (((tblGang.GangName)=[Enter Affiliation]) AND
((tblInmGangData.Inactive)=False));
It worked till I found out that an Inmate could be a member of more than one
gang so I had to change the primary key in the tblInmGangData from just
DOCNuber to DOCNumber and Affilation now I can not edit any of the data in my
query.
I posted this yesterday on Programming but got no help.
Any ideas would be helpful.
enter data.
SELECT tblInmGangData.DOCNumber, inmtinfo.IN_NAME, tblInmGangData.NName,
tblInmGangData.Rank, inmtinfo.IN_OFFENSE, inmtinfo.IN_CMTCNTY,
inmtinfo.IN_SNTCLAS, inmtinfo.IN_EFFDATE, inmtinfo.IN_MINDATE,
inmtinfo.IN_MAXDATE, inmtinfo.IN_MINSNT, inmtinfo.IN_MAXSNT, inmtinfo.IN_WA1,
tblInmGangData.STGMisconducts, tblInmGangData.Comments, tblInmGangData.Photo,
tblInmGangData.Tattoo1, tblInmGangData.Tattoo2, tblInmGangData.Tattoo3,
tblInmGangData.Files, tblGang.GangName, [IN_BLDING] & "-" & [IN_SECTION] &
"-" & [IN_CELLDRM] & "-" & [IN_BEDNUM] AS BSCB, tblInmGangData.Inactive
FROM tblGang RIGHT JOIN (tblInmGangData INNER JOIN inmtinfo ON
tblInmGangData.DOCNumber = inmtinfo.IN_INMNUM) ON tblGang.GangID =
tblInmGangData.Affilation
WHERE (((tblGang.GangName)=[Enter Affiliation]) AND
((tblInmGangData.Inactive)=False));
It worked till I found out that an Inmate could be a member of more than one
gang so I had to change the primary key in the tblInmGangData from just
DOCNuber to DOCNumber and Affilation now I can not edit any of the data in my
query.
I posted this yesterday on Programming but got no help.
Any ideas would be helpful.