error in code

krc777

Registered User.
Local time
Today, 06:23
Joined
Nov 29, 2005
Messages
70
I have the following code in an Access module:

UPDATE MainRptDataASD SET PlanName = (SELECT Plan FROM CHPs, MainRptDataASD WHERE CHPs.PlanID = MainRptDataASD.PlanID)

I'm getting this error: Operation must use an updateable query.

This is an updateable query. I perform other updates and it works well. It seems that this SELECT Plan FROM CHPs, MainRptDataASD WHERE CHPs.PlanID = MainRptDataASD.PlanID is the problem.

Can anyone tell me why?
Thanks
k
 
In Access/Jet, this is NOT an updatable query.

Try this instead:
UPDATE MainRptDataASD INNER JOIN CHPs ON MainRptDataASD.PlanID = CHPs.PlanID
SET MainRptDataASD.PlanName = CHPs.Plan;
 
That worked great! Thank you so much.
 

Users who are viewing this thread

Back
Top Bottom