query not updatable

G

Guest

The first query is not updatable and the second one is. I don't see
what the difference is other than the tables and fields. Can someone pls
show me the differnce, I need to have the frist one updatable.

Thanks, Robert


SELECT tblOPmeds.fldOPmedNo, tblOPmeds.fldPINo, tblOPmeds.fldOPmedLUno,
tblOPmeds.fldDose, tblOPmeds.fldUnits, tblOPmeds.fldRoute,
tblOPmeds.fldFrequency, tblOPmeds.fldStartDate, tblOPmeds.fldStopDate,
tblOPmeds.fldReasonStoped, tblOPmedsLU.fldClassification,
tblOPmedsLU.fldBRAND_NAME, tblOPmedsLU.fldGENERIC_NAME
FROM tblOPmedsLU INNER JOIN tblOPmeds ON tblOPmedsLU.fldOPMedsLUno =
tblOPmeds.fldOPmedLUno;
*********************************************************
SELECT tblDevices.fldPtDeviceNo, tblDevices.fldVisitNo,
tblDevices.fldDeviceNo, tblDeviceLU.fldDefibDeviceModName,
tblDeviceLU.fldDefibDeviceModNum, tblDevices.fldMode, tblDevices.fldRate,
tblDevices.fldReasonInterr, tblDevices.fldAthresh, tblDevices.fldApw,
tblDevices.fldLVthresh, tblDevices.fldLVpw, tblDevices.fldVentThresh,
tblDevices.fldVentPW, tblDevices.fldAimp, tblDevices.fldRVimp,
tblDevices.fldLVimp, tblDevices.fldHVBimp, tblDevices.fldHVX,
tblDevices.fldPwaveSens, tblDevices.fldRwaveSens, tblDevices.fldVpacePercent,
tblDevices.fldApacePercent, tblDevices.fldMDnote, tblDevices.Changes,
tblDeviceLU.fldManufactureID, tblDevices.fldSerialNo
FROM tblDevices INNER JOIN tblDeviceLU ON tblDevices.fldDeviceNo =
tblDeviceLU.fldDeviceNo;
 
A

Allen Browne

You are joining tblOPmedsLU to tblOPmeds.

The field fldOPmedLUno must have a unique index in one of those tables (the
one that is in the ONE side of the one-to-many relation.) Without that
index, the query will not be updatable.

To create the index, open the table in design view, and either make the
field the primary key, or set its Indexed property to "Yes (No Dupliates)"
in the lower pane of table design.

The unique index should solve it, but here's a list of other possibilities:
Why is my query read-only?
at:
http://allenbrowne.com/ser-61.html
 
G

Guest

Thank you Allen, the index was not set to unique. As always, I appreciate
your help and advice very much.

Rob
 
Top