Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Platform: Access 2000 logic with forms

Status
Not open for further replies.

jcarroll

Programmer
Jul 11, 2000
7
0
0
CA
Platform: Access 2000<br><br>Hi,<br><br>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<br>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.<br><br>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<br>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<br>flag.<br><br>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.<br><br>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.<br><br>Please forgive the length of my submission, any ideas, or pointers in the right direction would be greatly appreciated.<br><br>Justin Carroll<br>


 
What purpose does loading every form serve?&nbsp;&nbsp;Loading every form is using up precious memory. On your PC.&nbsp;&nbsp;If your forms load slow then buy faster computers. Access has everything to do with CPU Speed and Memory. PIII 500 with 128 meg is the norm&nbsp;&nbsp;If your company can’t affords faster computers then they are not looking at the most productive solution to keeping themselves in business.<br>I think you are spending way to much theorizing rather than getting the program finished.<br><br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Hey DougP, Some companies will not shell out the dollars for faster PC's.&nbsp;&nbsp;My company is using P1 166's for all of the laptops.&nbsp;&nbsp;I've got to deal with it.<br>I think you are very correct, but it's not fair to dump on jcarroll because his company may be &quot;thrifty&quot;. ;)<br><br>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.<br><br>I have a set way of loading my screens:&nbsp;&nbsp;Let's say the screens are opened 1,2,3.&nbsp;&nbsp;If the user opens screen 1, you open 2, and maybe 3 in the background.&nbsp;&nbsp;Then you can have your cake and eat it too.<br><br>I hope this helps.<br><br><br>
 
Hi guys, thanks for your reply's.&nbsp;&nbsp;My biggest problem isn't deciding when to load up my forms.&nbsp;&nbsp;In fact, Bigfoot, loading the forms your way would be perfectly fine for my application.&nbsp;&nbsp;Heck, I don't really need to pre-load at all.&nbsp;&nbsp;<br><br>To summarize, I am not looking for a performance boost when the users first open their forms.&nbsp;&nbsp;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.&nbsp;&nbsp;That is why I am only hiding them instead of closing them.&nbsp;&nbsp;<br><br>I don't know.&nbsp;&nbsp;It just seems strange that nobody else has had a need for a form_QueryUnload event and found a workaround.<br><br>Justin
 
I agree with the above. If you still neeed to hide <i>some</i> forms rather than close them, you might simply set the CloseButton property of the forms to No and add your own button that hides rather than closes the form. That way you don't have to mess with the actual OnClose event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top