Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query not updateable - how can i make it updateable?

Status
Not open for further replies.

mudstuffin

Technical User
Sep 7, 2001
92
GB
Hello. I hope someone can help with a query I have about a query.

Here is the SQL for a query I am trying to run in an access db. It is not updateable. Can anyone tell me what I am doing wrong? I need it to be updateable.

SELECT tblCRESTdata.CRESTcaseID, tblCRESTdata.[OUT-REG-NO], tblCRESTdata.[OUT-GROUPNO], tblCRESTdata.[OUT-SUB-FORENAME], tblCRESTdata.[OUT-SUB-SURNAME], tblCRESTdata.[OUT-DOB], tblCRESTdata.[OUT-PAT-FORENAME], tblCRESTdata.[OUT-PAT-SURNAME], tblCRESTdata.[OUT-CLAIM-NO], tblCRESTdata.[OUT-GROUP-NAME], MyNewTable.NewTableID, MyNewTable.crestID, MyNewTable.TelNo, MyNewTable.Contact1, MyNewTable.Contact2, MyNewTable.Contact3, MyNewTable.Contact4, MyNewTable.ContactMade, MyNewTable.NeedToTryAgain, tblCRESTdata.[OUT-ACC-TYPE], MyNewTable.UnableToObtainTel, MyNewTable.UserNm, tblAdmin.AdminCRESTcaseID, tblAdmin.CaseStatus
FROM (tblCRESTdata LEFT JOIN MyNewTable ON tblCRESTdata.CRESTcaseID = MyNewTable.crestID) LEFT JOIN tblAdmin ON tblCRESTdata.CRESTcaseID = tblAdmin.AdminCRESTcaseID
WHERE (((tblAdmin.CaseStatus) Like "*suspen*"));


It is ok when it was like this:

SELECT tblCRESTdata.CRESTcaseID, tblCRESTdata.[OUT-REG-NO], tblCRESTdata.[OUT-GROUPNO], tblCRESTdata.[OUT-SUB-FORENAME], tblCRESTdata.[OUT-SUB-SURNAME], tblCRESTdata.[OUT-DOB], tblCRESTdata.[OUT-PAT-FORENAME], tblCRESTdata.[OUT-PAT-SURNAME], tblCRESTdata.[OUT-CLAIM-NO], tblCRESTdata.[OUT-GROUP-NAME], MyNewTable.NewTableID, MyNewTable.crestID, MyNewTable.TelNo, MyNewTable.Contact1, MyNewTable.Contact2, MyNewTable.Contact3, MyNewTable.Contact4, MyNewTable.ContactMade, MyNewTable.NeedToTryAgain, tblCRESTdata.[OUT-ACC-TYPE], MyNewTable.UnableToObtainTel, MyNewTable.UserNm
FROM tblCRESTdata LEFT JOIN MyNewTable ON tblCRESTdata.CRESTcaseID = MyNewTable.crestID;

But I need to add in the third table (tbladmin) to specify the criteria.

Regards,

Greg.

 
a query becomes not updateable if/when you have a 1 to many link because esentially the database don't know which record you want to be updating...

if you keep all your links to 1-1, and ensure the data exsists on both sides(inner joins), then it should let you update...



--------------------
Procrastinate Now!
 
And this ?
FROM (tblCRESTdata
INNER JOIN tblAdmin ON tblCRESTdata.CRESTcaseID = tblAdmin.AdminCRESTcaseID)
LEFT JOIN MyNewTable ON tblCRESTdata.CRESTcaseID = MyNewTable.crestID
WHERE tblAdmin.CaseStatus Like '*suspen*';

You may have a look here:

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top