
Disable Access Close Button not Form Close Button?
hello Mark
you declare the variable as public in the declarations
section of the form (just under Option Explicit And option
compare...) and then set it's value to true in the click
event of the button (you dont need to reset it's value to
False since boolean variables are false until changed)
good luck
Erez.
Quote:
>-----Original Message-----
>Hi All,
>I've been searching through google for the answer to this
problem and I know
>there is a way to do this by going to the MS
Knowledgebase. However I think
Quote:
>what I'd rather do is what someone else suggested which
is when close is
>called then put up a message box to say you must exit via
the button on the
>switchboard.
>They said to use the code below.
>>Add to your switchboard a boolean variable (I
used "AllowClose"). Set
Quote:
>>the variable to false. Then add something like the
following to the
>>Unload event of your Switchboard form.
>> If Not AllowClose Then
>> MsgBox "You must use the 'Quit' button to exit
this application!",
>vbInformation + vbOKOnly, "Illegal Escape"
>> Cancel = True
>> End If
>>Then in the click event for your Quit button, add a line
to set
>>AllowClose to True.
>I understand how to add code to the events but not how to
set the boolean
>variable
>to start with do you do this on a Public Function in a
Module? If so how?
>TIA
>Mark
>.