Scope lost after DoCmd.Quit???

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I've inherited a .MDB and found that the original programmer has an "Exit"
button on the main form "DoCmd.Quit" in the ON CLICK event code.

He also had some code in the ON UNLOAD event for the form.

I now need change the ON UNLOAD event so that the execution of some of the
code in there is dependant on a value in a public variable, but it appears
to me that all public variable have lost scope once "DoCmd.Quit" is
executed. Is this true? Do any variables survive DoCmd.Quit?

Thanks
 
Dave said:
I've inherited a .MDB and found that the original programmer has an
"Exit" button on the main form "DoCmd.Quit" in the ON CLICK event
code.

He also had some code in the ON UNLOAD event for the form.

I now need change the ON UNLOAD event so that the execution of some
of the code in there is dependant on a value in a public variable,
but it appears to me that all public variable have lost scope once
"DoCmd.Quit" is executed. Is this true? Do any variables survive
DoCmd.Quit?

Thanks

I don't have time to test this out now, but ISTR that it's true -- you
can't count on any public variables after DoCmd.Quit has been called.
Maybe you could grab the value of the public variable, before calling
the Quit method, and stick it in an invisible text box on the form that
is to be unloaded.
 
Back
Top