G
Guest
I'm not sure if this is the right place to post this, but I'm hoping someone
else has ran into this issue and possibly has a workaround. (I think this is
a bug in Access 2003).
I've created a parent table, tblParent, with a primary key.
I've created a child table, tblChild, with a foreign key to parent,
enforcing referential integrity.
I've created a simple single form for both, frmParent and frmChild.
In frmParent, I create a timer (value of say 2000 ms) that runs some code
OnTimer (in this example it just immediately returns).
In frmChild, I made a button that deletes the current record OnClick using
the following code (except for the msgbox, the code was generated by the
wizard):
MsgBox "About to delete child..."
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
The issue I've noticed is if I have both frmParent and frmChild open at the
same time and allow frmParent to have focus for at least the length of the
timer (in this case 2 seconds), when I attempt to delete the child, the
current PARENT deletes. If I open the parent and child forms but do not
allow the 2 seconds to pass, the delete works as expected. Also, if I remove
the MsgBox call before the DoCmds in the child form, it works fine too.
Can someone else replicate and verify this? If this is a bug, does anyone
have a workaround or even know how to report it?
Thanks.
else has ran into this issue and possibly has a workaround. (I think this is
a bug in Access 2003).
I've created a parent table, tblParent, with a primary key.
I've created a child table, tblChild, with a foreign key to parent,
enforcing referential integrity.
I've created a simple single form for both, frmParent and frmChild.
In frmParent, I create a timer (value of say 2000 ms) that runs some code
OnTimer (in this example it just immediately returns).
In frmChild, I made a button that deletes the current record OnClick using
the following code (except for the msgbox, the code was generated by the
wizard):
MsgBox "About to delete child..."
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
The issue I've noticed is if I have both frmParent and frmChild open at the
same time and allow frmParent to have focus for at least the length of the
timer (in this case 2 seconds), when I attempt to delete the child, the
current PARENT deletes. If I open the parent and child forms but do not
allow the 2 seconds to pass, the delete works as expected. Also, if I remove
the MsgBox call before the DoCmds in the child form, it works fine too.
Can someone else replicate and verify this? If this is a bug, does anyone
have a workaround or even know how to report it?
Thanks.