I am well aware of how to cancel a form from closing (set 'cancel = true' in unload event) but i would like this prevention to be based on how the cancel event was started. i know i have seen code for this somewhere online while looking for something else but now i can't seem to find it. What i want is to prevent the closing of the form in all other ways but when i call it from code with docmd.close.
From what i remember about this is that you had some value that told you how the form close had been initiated (like 1 if it's called from close, 2 if its called by the system, 3 if you hit the clsoe button, etc etc)and that you could base your code on this. Does any one know what i'm talking of? I know i did try it when i found it the last time and I think it worked pretty well for the thing i need to use it for now!
All help and ideas appreciated!![]()