Hi,
I have a really hard nut to crack.
Ha have a main form containing 4 subforms in different tabs. From subform A I have a button that deletes a record in a list.
If MsgBox("Delete selected record?", _
vbYesNo + vbCritical, "Delete") = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
The record is deleted and A is updated (I can see Me.ID change). The problem is the subform B that is presenting details from subform A. This doesn't update properly, it's still pointing at the deleted record (I print Me.ID). I have tried refresh, requery and DoCmd.RunCommand acCmdRefresh, but nothing works.
Anyone got any tips?
I have a really hard nut to crack.
Ha have a main form containing 4 subforms in different tabs. From subform A I have a button that deletes a record in a list.
If MsgBox("Delete selected record?", _
vbYesNo + vbCritical, "Delete") = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
The record is deleted and A is updated (I can see Me.ID change). The problem is the subform B that is presenting details from subform A. This doesn't update properly, it's still pointing at the deleted record (I print Me.ID). I have tried refresh, requery and DoCmd.RunCommand acCmdRefresh, but nothing works.
Anyone got any tips?