A
Ann in CA
Original code:
strCommand = "DELETE tblCMValues.* FROM qryCMValues WHERE [CMID] = " &
strZeroID & " AND [Type] = """ & strType & """"
However, Type is in a different table in the query, so I was getting error
3086 "Could not delete from specified tables." My attempt to fix, based on
responses found on this board:
strCommand = "DELETE DistinctRow tblCMValues.* FROM tblCMValues (INNERJOIN
tblMeasurements ON tblCMValues.MeasID = tblMeasurements.MeasAutoID) WHERE
[CMID] = " & strZeroID & " AND [Type] = """ & strType & """"
This causes Error 3131. So I read a bit more and tried another approach,
which doesn't execute at all:
strCommand = "DELETE DistinctRow tblCMValues.* " FROM tblCMValues WHERE
[CMID] = " & strZeroID & " AND tblCMValues.measID IN (Select MeasAutoID FROM
tblMeasurements WHERE [Type] = """ & strType & """)"
If anyone knows how to fix this, they would have my utmost respect and
gratitude =)
strCommand = "DELETE tblCMValues.* FROM qryCMValues WHERE [CMID] = " &
strZeroID & " AND [Type] = """ & strType & """"
However, Type is in a different table in the query, so I was getting error
3086 "Could not delete from specified tables." My attempt to fix, based on
responses found on this board:
strCommand = "DELETE DistinctRow tblCMValues.* FROM tblCMValues (INNERJOIN
tblMeasurements ON tblCMValues.MeasID = tblMeasurements.MeasAutoID) WHERE
[CMID] = " & strZeroID & " AND [Type] = """ & strType & """"
This causes Error 3131. So I read a bit more and tried another approach,
which doesn't execute at all:
strCommand = "DELETE DistinctRow tblCMValues.* " FROM tblCMValues WHERE
[CMID] = " & strZeroID & " AND tblCMValues.measID IN (Select MeasAutoID FROM
tblMeasurements WHERE [Type] = """ & strType & """)"
If anyone knows how to fix this, they would have my utmost respect and
gratitude =)