Why #Deleted is seen on the child sub-form when a record is deleted from master subform

%3CLINGO-SUB%20id%3D%22lingo-sub-1244497%22%20slang%3D%22en-US%22%3EWhy%20%23Deleted%20is%20seen%20on%20the%20child%20sub-form%20when%20a%20record%20is%20deleted%20from%20master%20subform%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1244497%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20created%20a%20form%20with%20form%20wizard%20in%20MS%20Access%20including%20two%20linked%20sub-forms.When%20I%20delete%20a%20record%20from%20Master%20sub-form%20the%20%23Deleted%20is%20seen%20on%20the%20child%20sub-form%20as%20well%20as%20database%20tables.%20I%20did%20not%20have%20such%20a%20problem%20before.%20How%20can%20I%20fix%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1244497%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1244986%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20%23Deleted%20is%20seen%20on%20the%20child%20sub-form%20when%20a%20record%20is%20deleted%20from%20master%20subform%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1244986%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F589706%22%20target%3D%22_blank%22%3E%40Farshad79%3C%2FA%3E%26nbsp%3BThis%20is%20because%20the%20form's%20recordsource%20is%20not%20requeried%20after%20the%20delete%20and%20that%20now%20deleted%20record%20is%20being%20flagged%20because%20it%20WAS%20in%20the%20recordsource.%20You%20can%20avoid%20this%20by%20immediately%20requerying%20the%20form's%20recordsource%20after%20deleting%20the%20record.%20That%20will%20return%20a%20new%20recordset%20which%20no%20longer%20contains%20the%20deleted%20record.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

I have created a form with form wizard in MS Access including two linked sub-forms.When I delete a record from Master sub-form the #Deleted is seen on the child sub-form as well as database tables. I did not have such a problem before. How can I fix it?

1 Reply
Highlighted

@Farshad79 This is because the form's recordsource is not requeried after the delete and that now deleted record is being flagged because it WAS in the recordsource. You can avoid this by immediately requerying the form's recordsource after deleting the record. That will return a new recordset which no longer contains the deleted record.