Or, Just have this hidden form actually DO the maintenance you want to
accomplish. That way, the maintenance code runs whichever way the user
closes Access.
-Tom
"Wayne Morgan" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> When you open Access, open a hidden form. In the Unload event of this form,
> check for the value of a global "flag" variable you have created. If the
> value isn't what was expected, set Cancel = True to cancel closing this
> form. You may even want to pop-up a message box explaining the problem. When
> you close the form the way you desire, set the value of the variable so that
> the Cancel isn't triggered.
>
> --
> Wayne Morgan
> Microsoft Access MVP
>
>
> "Gerry" <(E-Mail Removed)> wrote in message
> news:1d0b501c453bf$09240130$(E-Mail Removed)...
> > Is there a way to either deactivate or else add code to
> > the close button in Access XP
> >
> > My end users are closing the database by using the close
> > button for Access instead of using the custom command
> > button I have created. When they use the close button
> > maintanence code does not run.
> >
> > Any guidance would be appreciated.
> >
> > Thanks
|