Hi Mik,
Sorry, I don't think I understand the question. On the Unload event, you
can check for circumstances when you want to avoid closing the form. To
actually prevent it from closing, set Cancel=True.
Cancel=(Weekday(date)=VbSunday)
This will prevent the form from closing on Sundays :).
If you need to do data validation, form's BeforeUpdate event also gives you
the Cancel method.
For the extra question, no, I don't see anything wrong with the code.
HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://www.*-*-*.com/ ~dashish )
---------------
:Hi Dev,
:
:Thank you for tanking time to answering, but how can I trap this
:information.
:
:The form is a menu thats means that I have some code in the CloseEvent,
:which
:comes after the UnloadEvent.
:
:That means I have to put some code in the UnloadEvent that will
:"disable" all the other events on the form. Do you get the point.
:
:A little extra question
:
:What is wrong with this code:
:
:If CurrentUser = "Supervisor" Then
:...then do something
:Else
:....then do something else
:end if
:
:and for the "endding" what a wonderfull place this Dev's World in
{*filter*}Space
: http://www.*-*-*.com/ ~dashish
:
:Thanks in advance
:
:Mik
:
:>Hi Mik,
:>Put code behind the form's Unload event. You should be able to trap it
:from
:>here, and set to Cancel if needed,
:
: