Platform: Access 2000 logic with forms
Platform: Access 2000 logic with forms
(OP)
Platform: Access 2000
Hi,
I am having difficulty figuring out the logic behind closing the forms in my database. I have just changed the structure of my database sothat it loads all forms in hidden mode on startup and then unhides
them when the user chooses to open them. When the user chooses to close a form I simply hide it and reset its data. This works fine until you want to close the application in which case the the cancelling of the forms' unload events, ends up cancelling the application close.
I thought that I might be able to work around this by loading a hidden dummy form on startup and then when the application calls its unload event setting a flag to true. This way when the other forms unload events are triggered they can check this flag and decide whether or
not to cancel unload. However, I cannot find a way for my dummy form to be the first form that is unloaded and therefore cannot insure that the flag is set. Furthermore, once one form has cancelled application shutdown, access does not even move onto the dummy form to set the
flag.
I thought that I'd remembered a way to do this in VB. The queryunload event, which passes the cause of the event as a constant. Is there away to obtain the functionality of this event in Access.
I also have the option of providing my own close buttons on forms and then simply hiding them when it is clicked, this way there is no code in their unload events. However, if possible I would like to stay with the original control box close buttons.
Please forgive the length of my submission, any ideas, or pointers in the right direction would be greatly appreciated.
Justin Carroll
Hi,
I am having difficulty figuring out the logic behind closing the forms in my database. I have just changed the structure of my database sothat it loads all forms in hidden mode on startup and then unhides
them when the user chooses to open them. When the user chooses to close a form I simply hide it and reset its data. This works fine until you want to close the application in which case the the cancelling of the forms' unload events, ends up cancelling the application close.
I thought that I might be able to work around this by loading a hidden dummy form on startup and then when the application calls its unload event setting a flag to true. This way when the other forms unload events are triggered they can check this flag and decide whether or
not to cancel unload. However, I cannot find a way for my dummy form to be the first form that is unloaded and therefore cannot insure that the flag is set. Furthermore, once one form has cancelled application shutdown, access does not even move onto the dummy form to set the
flag.
I thought that I'd remembered a way to do this in VB. The queryunload event, which passes the cause of the event as a constant. Is there away to obtain the functionality of this event in Access.
I also have the option of providing my own close buttons on forms and then simply hiding them when it is clicked, this way there is no code in their unload events. However, if possible I would like to stay with the original control box close buttons.
Please forgive the length of my submission, any ideas, or pointers in the right direction would be greatly appreciated.
Justin Carroll
RE: Platform: Access 2000 logic with forms
I think you are spending way to much theorizing rather than getting the program finished.
DougP
dposton@universal1.com
Ask me how Bar-codes can help you be more productive.
RE: Platform: Access 2000 logic with forms
I think you are very correct, but it's not fair to dump on jcarroll because his company may be "thrifty". ;)
jcarroll: I think DougP is correct in saying if you load all the forms on startup, you may be asking for out of memory problems, or lot's of disk caching.
I have a set way of loading my screens: Let's say the screens are opened 1,2,3. If the user opens screen 1, you open 2, and maybe 3 in the background. Then you can have your cake and eat it too.
I hope this helps.
RE: Platform: Access 2000 logic with forms
To summarize, I am not looking for a performance boost when the users first open their forms. Instead I am looking for a performance boost when the user is re-opening forms, forms that they have intuitively closen while switching to other forms in the database. That is why I am only hiding them instead of closing them.
I don't know. It just seems strange that nobody else has had a need for a form_QueryUnload event and found a workaround.
Justin
RE: Platform: Access 2000 logic with forms