Eljefegeneo
Still trying to learn
- Local time
- Today, 11:49
- Joined
- Jan 10, 2011
- Messages
- 902
Report A is a find duplicates report that shows the duplicate entry of two records on two different forms from two different tables, tblMain & frmMain and tblNew and frmNew. The report has an OnClick action for the tblMain ID number to bring up the record in frmMain and frmNew that are duplicates. When I have frmNew open, and I click on delete the record using: DoCmd.RunCommand acCmdDeleteRecord, nothing seems to happen, that is, the record on frmNew is not deleted. If I click on the tab for frmMain, there is no record any more, as if it is deleted. But it still exists.
I tried the following for the delete record button on frmNew:
DoCmd.Close acForm, "frmMain"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
That deletes the record, but why should I have to do this? Is it because the report is still open and thus the underlying query open which prevents the record from being deleted?
I am just trying to understand the reasoning behind the various codes and actions so that don’t spend hours again trying to solve a problem which really has a simple answer. Thanks.
I tried the following for the delete record button on frmNew:
DoCmd.Close acForm, "frmMain"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
That deletes the record, but why should I have to do this? Is it because the report is still open and thus the underlying query open which prevents the record from being deleted?
I am just trying to understand the reasoning behind the various codes and actions so that don’t spend hours again trying to solve a problem which really has a simple answer. Thanks.