Y
Yarik
Hi,
Recently stepped on the following fragment in the legacy code (only
relevant lines of code are left):
' In response to a click on some button
Private Sub cmdMyButton_Click()
Dim frmFoo as Form_Foo
Set frmFoo as New Form_Foo
Call frmFoo.SomeInitializationMethod(...)
frmFoo.Visible = True
End Sub
When this code runs in MS Access 2003, the form behaves exactly as I
would expect it to do: once a user presses the button, the Foo form
shows up for a split second and immediately disappears. Assuming that
frmFoo variable is the only reference to the instance of Foo form
created in event handler, this instance gets closed once this variable
goes out of scope. This is understandable, and this is how most of the
forms work both in Access 2003 and Access 2000...
Now, the problem is that this particular Foo form does not work that
way in Access 2000: instead of just flashing, it shows up on the
screen and does not go away. As if the frmFoo variable were no longer
the only reference to the form's instance. Since this form does go
away in Access 2003, I think that the problem is not in the legacy
code. I think the problem is somewhere in Access itself: something in
Access 2000 makes this form get referenced by something that seems to
be out of my control. What could it be? The form in question has two
subforms - could those subforms be responsible for such behavior in
Access 2000? If yes, then is it documented anywhere?
Please advise.
Thank you,
Yarik.
Recently stepped on the following fragment in the legacy code (only
relevant lines of code are left):
' In response to a click on some button
Private Sub cmdMyButton_Click()
Dim frmFoo as Form_Foo
Set frmFoo as New Form_Foo
Call frmFoo.SomeInitializationMethod(...)
frmFoo.Visible = True
End Sub
When this code runs in MS Access 2003, the form behaves exactly as I
would expect it to do: once a user presses the button, the Foo form
shows up for a split second and immediately disappears. Assuming that
frmFoo variable is the only reference to the instance of Foo form
created in event handler, this instance gets closed once this variable
goes out of scope. This is understandable, and this is how most of the
forms work both in Access 2003 and Access 2000...
Now, the problem is that this particular Foo form does not work that
way in Access 2000: instead of just flashing, it shows up on the
screen and does not go away. As if the frmFoo variable were no longer
the only reference to the form's instance. Since this form does go
away in Access 2003, I think that the problem is not in the legacy
code. I think the problem is somewhere in Access itself: something in
Access 2000 makes this form get referenced by something that seems to
be out of my control. What could it be? The form in question has two
subforms - could those subforms be responsible for such behavior in
Access 2000? If yes, then is it documented anywhere?
Please advise.
Thank you,
Yarik.