Hi,
Very strange problem, using the code below, I have a button that delete's the current record, sometimes it works as expected, sometimes does not delete the record but more oddly it deletes a record on a different form, the form is a main menu A, is open but not even the calling form so when this single form C is closed it should revert to B anyway.
A Menu
B List form tabular
C individual single form
Had this form and code for years, never had a problem before, tinkered with it a little but even rolling back to quite old versions the problem still remains.
Does not seem to be a pattern when it fails, usually when I try to delete the records that failed at first, it works the second time.
Almost like a bug, hence importing old version of that form, compact & repair, even decompile.
As I type, thinking I had added a combo box, based on a different table but this was a while ago and had been fine in between but he most significant change.
I will delete & test some more but sort of would like to know why its doing this even if a bug.
After closing is should be on for B & that is the one that is visible but if go to the Menu form A, the record has been deleted, its just a single header type record.
Very strange problem, using the code below, I have a button that delete's the current record, sometimes it works as expected, sometimes does not delete the record but more oddly it deletes a record on a different form, the form is a main menu A, is open but not even the calling form so when this single form C is closed it should revert to B anyway.
A Menu
B List form tabular
C individual single form
Had this form and code for years, never had a problem before, tinkered with it a little but even rolling back to quite old versions the problem still remains.
Does not seem to be a pattern when it fails, usually when I try to delete the records that failed at first, it works the second time.
Almost like a bug, hence importing old version of that form, compact & repair, even decompile.
As I type, thinking I had added a combo box, based on a different table but this was a while ago and had been fine in between but he most significant change.
I will delete & test some more but sort of would like to know why its doing this even if a bug.
Code:
DoCmd.SetWarnings False ' stop the cascading message, which also remove the option not to delete but don't really want by product choice anyway here
DoCmd.RunCommand acCmdDeleteRecord ' July 19 insetad of above
DoCmd.SetWarnings True
' MsgBox "deleted"
DoCmd.Close acForm, "Dogs Alter Fm 1"
After closing is should be on for B & that is the one that is visible but if go to the Menu form A, the record has been deleted, its just a single header type record.