G
Gareth Mercer
I have a query that is used to cascade a delete on a
single table with the following SQL
DELETE tblFolders.FolderID, tblFolders.Level,
tblFolders.ParentFolder, [Forms]![frmDeleteFolder]![Level]
AS [Level]
FROM tblFolders
WHERE (((tblFolders.FolderID)=[Forms]![frmDeleteFolder]!
[SelectedFolder]) AND ((tblFolders.Level)=[Forms]!
[frmDeleteFolder]![Level]) AND (([Forms]![frmDeleteFolder]!
[Level])=2)) OR (((tblFolders.ParentFolder)=[Forms]!
[frmDeleteFolder]![Subfolder1]) AND (([Forms]!
[frmDeleteFolder]![Level])=1)) OR
(((tblFolders.ParentFolder)=(SELECT [FolderID] FROM
[Select Level 1 for Delete])) AND (([Forms]!
[frmDeleteFolder]![Level])=0))
I know the problem is that the subquery is likely to
return more than 1 record, but how amend the SQL to allow
for this eventuality.
Many thanks in advance
Gareth
single table with the following SQL
DELETE tblFolders.FolderID, tblFolders.Level,
tblFolders.ParentFolder, [Forms]![frmDeleteFolder]![Level]
AS [Level]
FROM tblFolders
WHERE (((tblFolders.FolderID)=[Forms]![frmDeleteFolder]!
[SelectedFolder]) AND ((tblFolders.Level)=[Forms]!
[frmDeleteFolder]![Level]) AND (([Forms]![frmDeleteFolder]!
[Level])=2)) OR (((tblFolders.ParentFolder)=[Forms]!
[frmDeleteFolder]![Subfolder1]) AND (([Forms]!
[frmDeleteFolder]![Level])=1)) OR
(((tblFolders.ParentFolder)=(SELECT [FolderID] FROM
[Select Level 1 for Delete])) AND (([Forms]!
[frmDeleteFolder]![Level])=0))
I know the problem is that the subquery is likely to
return more than 1 record, but how amend the SQL to allow
for this eventuality.
Many thanks in advance
Gareth