Hi, I have a delete query that I want to use on another query. The other query has five tables in it, one as the main table, and the other 4 as subordinate tables, so a 1 to 1 relationship exits, as the data contained in the 4 subordinate tables makes up one complete record. When I try and run the delete query, it says that it cannot delete from specified tables. Here is the code:
DELETE *
FROM [qryDataEntry(Comment)]
WHERE ((([qryDataEntry(Comment)].strOrgCode)=[forms]![frmselect]![combo5]) AND (([qryDataEntry(Comment)].strMonth)=[forms]![frmselect]![combo11]) AND (([qryDataEntry(Comment)].strYear)=[forms]![frmselect]![combo13]) AND (([qryDataEntry(Comment)].SpecialtyCode)=[forms]![frmselect]![combo9]) AND (([qryDataEntry(Comment)].strRCodes)=[forms]![frmselect]![combo7]));
There is only data entered into the main data table (using the qryDataEntry(Comment) query), so the other tables do not contain data, not even an ID (which is created at the top of each table in order to link all the tables to the main data.
If anyone has any suggestions about how to get around this problem, they are greatly appreciated.
Thanks
DELETE *
FROM [qryDataEntry(Comment)]
WHERE ((([qryDataEntry(Comment)].strOrgCode)=[forms]![frmselect]![combo5]) AND (([qryDataEntry(Comment)].strMonth)=[forms]![frmselect]![combo11]) AND (([qryDataEntry(Comment)].strYear)=[forms]![frmselect]![combo13]) AND (([qryDataEntry(Comment)].SpecialtyCode)=[forms]![frmselect]![combo9]) AND (([qryDataEntry(Comment)].strRCodes)=[forms]![frmselect]![combo7]));
There is only data entered into the main data table (using the qryDataEntry(Comment) query), so the other tables do not contain data, not even an ID (which is created at the top of each table in order to link all the tables to the main data.
If anyone has any suggestions about how to get around this problem, they are greatly appreciated.
Thanks