P
Pedhoncdoc
To all ADP form gurus:
I have an extremely bad Undocumented Bug in Access XP ADPs:
Whenever there is a subform on a parent form, the parent form sends multiple
( 3 - 30 ) Form_Current Events to every subform of the ParentForm, whenever a
new record is inserted in the ParentForm.
Most people will never notice this (they don't use Form_Current event code),
but when you have any Form_Current event code, it will frequently crash
Access after multiple inserts involving ParentForm and Subform record insert
cycles. This happens even with the most simple forms in all of my test
projects. (I don't know what happens in MDBs.) Apparently, the aberrant
events lead to memory leaks or stack overflows that eventually crash Access.
All of my procedures are logged and have error-logging error handlers, so I
know that the problem does not occur in any of my code. When I exam a
procedure stack trace during the aberrant Form_Current events, the error
arises in "Non-Basic" code, or there is no parent procedure shown that is
producing the Form_Current event.
The problem occurs regardless of the form/subform RecordSource (SQL vs SP vs
parameterized SQL or SP), and is not solved by changing FetchDefaults,
UniqueTable, or ResyncCommand, etc.
The problem never occurs on the first insert, always on the second or third
insert into the Parent form.
The problem will occur in the middle of the ParentForm Form_BeforeInsert
event if that event is in use. Removing all BeforeInsert code does not
remove the problem, though.
----------------
My only workaround is to remove the subforms' SourceObjects, or to remove
the OnCurrent Event capture in subforms by setting
SubformControl.OnCurrent="", and resetting it in the AfterInsert and Undo
events. I'm not sure if the latter approach really solves the problem though.
----------------
This is really bad, especially when you have a lot of bound subforms.
Can anyone else confirm this? Any ideas for a solution? How does one
submit this to Microsoft - there used to be an email, but I don't have it now.
I have an extremely bad Undocumented Bug in Access XP ADPs:
Whenever there is a subform on a parent form, the parent form sends multiple
( 3 - 30 ) Form_Current Events to every subform of the ParentForm, whenever a
new record is inserted in the ParentForm.
Most people will never notice this (they don't use Form_Current event code),
but when you have any Form_Current event code, it will frequently crash
Access after multiple inserts involving ParentForm and Subform record insert
cycles. This happens even with the most simple forms in all of my test
projects. (I don't know what happens in MDBs.) Apparently, the aberrant
events lead to memory leaks or stack overflows that eventually crash Access.
All of my procedures are logged and have error-logging error handlers, so I
know that the problem does not occur in any of my code. When I exam a
procedure stack trace during the aberrant Form_Current events, the error
arises in "Non-Basic" code, or there is no parent procedure shown that is
producing the Form_Current event.
The problem occurs regardless of the form/subform RecordSource (SQL vs SP vs
parameterized SQL or SP), and is not solved by changing FetchDefaults,
UniqueTable, or ResyncCommand, etc.
The problem never occurs on the first insert, always on the second or third
insert into the Parent form.
The problem will occur in the middle of the ParentForm Form_BeforeInsert
event if that event is in use. Removing all BeforeInsert code does not
remove the problem, though.
----------------
My only workaround is to remove the subforms' SourceObjects, or to remove
the OnCurrent Event capture in subforms by setting
SubformControl.OnCurrent="", and resetting it in the AfterInsert and Undo
events. I'm not sure if the latter approach really solves the problem though.
----------------
This is really bad, especially when you have a lot of bound subforms.
Can anyone else confirm this? Any ideas for a solution? How does one
submit this to Microsoft - there used to be an email, but I don't have it now.