I get the following error:
object invalid or no longer set
when my code is running the following string:
DoCmd.RunCommand acCmdDeleteRecord
According to me, I get this error because there is no record selected or the record selected is Nothing.
How can I add a check before executing the code? It would be great to have something like:
If SelectedRecord != Nothing then
DoCmd.RunCommand acCmdDeleteRecord
End If