In my futile quest to delete a record in a subform I have stumbled across a couple DoCmd items which almost work. I first discovered DoCmd.RunCommand acCmdDeleteRow, but when I ran it I got a message that it was not available. Why? Then I tried this:
[Forms]![frmECNMasterData200]![BOMComponent(s)]! PartNumber.SetFocus
DoCmd.Echo False
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.Echo True
DoCmd.SetWarnings True
DoCmd.Close acForm, "frmWarningECN_BOM"
It almost works, except that it deletes the first record instead of the record where the SetFocus has put the curser. Why? Is there a way of telling it CurrentRecord? Thank you to anyone who can answer these questions
[Forms]![frmECNMasterData200]![BOMComponent(s)]! PartNumber.SetFocus
DoCmd.Echo False
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.Echo True
DoCmd.SetWarnings True
DoCmd.Close acForm, "frmWarningECN_BOM"
It almost works, except that it deletes the first record instead of the record where the SetFocus has put the curser. Why? Is there a way of telling it CurrentRecord? Thank you to anyone who can answer these questions