
Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Thankyou for the response.
The suggestion of OnUnload or OnClose of the form does not work
for me, because my VARIABLES LOSE THEIR VALUES in those
states? These two publicly defined Variables get assigned in the
Module1 module and work perfectly throughout the app, but lose
their value without reason, in the unload of the form? This is not an
option. Any other ideas? Can't I shut off the [X] close button of the
MS Access BlueBar?
> > Allow me to answer my own question:
> > Application.CommandBars("Menu Bar").Enabled = False
[quoted text clipped - 22 lines]
> Email (as appropriate) to...
> RBrandt at Hunter dot com
Bob Quintal - 30 Jun 2006 01:08 GMT
> Thankyou for the response.
> The suggestion of OnUnload or OnClose of the form does not
[quoted text clipped - 4 lines]
> This is not an option. Any other ideas? Can't I shut off the
> [X] close button of the MS Access BlueBar?
No you cannot shut off that X, without some very serious hacking of
the operating system.
You say you lose some publically defined variables. Variables have
to be initialized and set to a value to be any use. You may want to
store those values in a table somewhere, so that they can be
restored when you reopen the database.

Signature
Bob Quintal
PA is y I've altered my email address.
--
Posted via a free Usenet account from http://www.teranews.com
Randy Harris - 30 Jun 2006 01:29 GMT
* ApexData@gmail.com:
> Thankyou for the response.
> The suggestion of OnUnload or OnClose of the form does not work
[quoted text clipped - 30 lines]
>> Email (as appropriate) to...
>> RBrandt at Hunter dot com
You can drive a nail in with a bowling ball but your time might be
better spent looking for your hammer.
pietlinden@hotmail.com - 30 Jun 2006 02:01 GMT
> Thankyou for the response.
> The suggestion of OnUnload or OnClose of the form does not work
[quoted text clipped - 4 lines]
> option. Any other ideas? Can't I shut off the [X] close button of the
> MS Access BlueBar?
So leave the form open the whole time the app is running. Just hide
it. Then who cares if the variables go out of scope when the form
closes?
Rick Brandt - 30 Jun 2006 03:34 GMT
> Thankyou for the response.
> The suggestion of OnUnload or OnClose of the form does not work
> for me, because my VARIABLES LOSE THEIR VALUES in those
> states? These two publicly defined Variables get assigned in the
> Module1 module and work perfectly throughout the app, but lose
> their value without reason, in the unload of the form?
There is no specific reason for a public variable to lost its value in these
events. In an MDB though public variables can lose their value when an
unhandled error occurs. Many developers avoid this problem by using hidden
TextBoxes or TextBoxes on hidden forms instead of public variables.
Since you need a hidden form for its Close/Unload event then you have a
perfectly logical container for such TextBoxes.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
ApexData@gmail.com - 30 Jun 2006 04:00 GMT
You're correct Rick.
I discovered that my Variable values were lost because I had left
the "DoCmd.Quit" statement in "MyCloseButton", so when the
Unload of the form took place my Variable values had already been
discarded. I corrected the problem.
Thankyou All for your advice.
Greg
> > Thankyou for the response.
> > The suggestion of OnUnload or OnClose of the form does not work
[quoted text clipped - 15 lines]
> Email (as appropriate) to...
> RBrandt at Hunter dot com