Need to make qry Updateable

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

Guest

I would like to update the fields AdvTime in my query. Currently Access is
not allowing me to do this. Both fields are from seperate tables and are
Yes/No formats.

SELECT tblMABR_Plan.[Hospital No], tblMABR.DateMABR, tblMABR.AdvTime,
tblMABR_Plan.AdvTime
FROM tblMABR_Plan INNER JOIN tblMABR ON tblMABR_Plan.[Hospital No] =
tblMABR.[Hospital No]
WHERE (((tblMABR_Plan.[Hospital No])=62312));

Is there a way to do this?
 
hi,
Is there a way to do this?
Yes, check whether both tables have defined a primary key. Include these
key fields into your query.


mfG
--> stefan <--
 
Both tables do have a primary key named MABR_ID. I have included these
fields into my query but still cannot update AdvTime.

SELECT tblMABR.[MABR ID], tblMABR_Plan.[MABR ID], tblMABR_Plan.[Hospital
No], tblMABR.DateMABR, tblMABR.AdvTime, tblMABR_Plan.AdvTime
FROM tblMABR_Plan INNER JOIN tblMABR ON tblMABR_Plan.[Hospital No] =
tblMABR.[Hospital No]
WHERE (((tblMABR_Plan.[Hospital No])=62312));
 
hi,
Both tables do have a primary key named MABR_ID. I have included these
fields into my query but still cannot update AdvTime.
A query needs to be key preserving, when you like to update it.
Including the primary key fields is normally sufficent. Try adding an
index on [Hospital No] in both tables.


mfG
--> stefan <--
 
Thank you Stefan. I am now able to update this query.
Brian

Stefan Hoffmann said:
hi,
Both tables do have a primary key named MABR_ID. I have included these
fields into my query but still cannot update AdvTime.
A query needs to be key preserving, when you like to update it.
Including the primary key fields is normally sufficent. Try adding an
index on [Hospital No] in both tables.


mfG
--> stefan <--
 
I would like to update the fields AdvTime in my query. Currently Access is
not allowing me to do this. Both fields are from seperate tables and are
Yes/No formats.

SELECT tblMABR_Plan.[Hospital No], tblMABR.DateMABR, tblMABR.AdvTime,
tblMABR_Plan.AdvTime
FROM tblMABR_Plan INNER JOIN tblMABR ON tblMABR_Plan.[Hospital No] =
tblMABR.[Hospital No]
WHERE (((tblMABR_Plan.[Hospital No])=62312));

Is there a way to do this?

Is there a unique Index on [Hospital No] in tblMABR_Plan? If not, Access can't
uniquely identify which record should be updated.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top