Solved

Problem with Access 2000 Zoom Control.  Modal form freezes app. to user input.

Posted on 2004-03-26
9
305 Views
Last Modified: 2006-11-17
1) Have a hidden form with a timer event. In the case that a user has left the app. alone too long, the timer event opens a warning form with a countdown.  It's opened with the Modal property = true.  There is a CANCEL button that resets the timer and rehides the warning form.  If the timer reaches it's end, it closes and saves all.  It works great except...

... if a user has ZOOMED in on a control and is editing it's data using the Access Zoom Control (SHIFT+F2).

In this case the countdown dialog appears and counts down.  However the Zoom Control and My Modal Form seem to conflict and put the app. in a state immune to user input.  The only recourse is to wait for the timer to expire.

I need to be able to allow users to Cancel even if the Zoom form is open.  This seems to be Windows API-level behavior, but I'm not at all familiar with Windows API stuff, nor do I want to learn it.  Any suggestions for how to handle this situation?

Thank you in advance.
0
Comment
Question by:steverke
  • 5
  • 4
9 Comments
 
LVL 54

Expert Comment

by:nico5038
Comment Utility
Did you place a DoEvents in the countdown loop ?

Nic;o)
0
 

Author Comment

by:steverke
Comment Utility
This is a good suggestions, however it did not work.  I put DoEvnets into the code and used logging to verify that it was being called.  In tests, DoEvents was called dozens of times and Access did not respond to any of my mouse clicks.  I even tried changing the timeout form's modal state to NO, with no effect.

It's not a countdown loop.  The time check occurs in a Form's Timer event.  Every so often, 1 second, 5 seconds (however configured - varies based on how soon until timeout) the form checks the current time vs. the saved time.  When it is close to autoshutdown, the countdown form is made visible and then counts down.  The countdown clock is adjusted by the forms OnTimer event... Hence no looping.

I'm starting to think I'll need to build a custom ZOOM Form.  Probably, the Access ZOOM control needs to be yielding to Windows Events but does not.  Don't know enough about it to guess.

Any other suggestions before I build my own ZOOM?

Thank you.
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility
Hmm did you also try to use:
Modal property = false
I've had some trouble with modal/popup forms as they didn't trigger events when returning to the mainform...

Nic;o)
0
 

Author Comment

by:steverke
Comment Utility
I did set modal = false prior to calling DoEvents.  Didn't work.

Just tried explicitly setting the focus to the shutdown form prior to calling DoEvents.  No good.

Still experimenting... any suggestions are VERY welcome.

Thank you.


0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 54

Accepted Solution

by:
nico5038 earned 500 total points
Comment Utility
Hmm, running out of them.
Some wild thoughts:
- A blunt solution could be to disable the Access Zoom Control (SHIFT+F2) :-)
- Create a VisualBasic .dll to do this
- Run you hidden timer form in another .mdb
- Skip the whole timeout, just lock the application when it has been idle too long and force an new logon

Nic;o)
0
 

Author Comment

by:steverke
Comment Utility
I thought about trying to track or muscle the Zoom cotrol via Windows API, but I have too little knowledge/experience along those lines to be able to figure it out expiditiously.

Thanks for the suggestions, however. The parallel MDB idea is clever... but I'm not too thrilled with the idea of having an extra .mdb just for timing out my users. In any case, your suggestions are on the mark and you will get your points.  

I've decided to create my own Zoom Form... a quick fix... and have it explicitly interact with the timeout process to share control and track the application state.  Will only take a couple hours to prototype out. Hopefully it works ;)
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility
Let me know when I can assist.

Success with the application !

Nic;o)
0
 

Author Comment

by:steverke
Comment Utility
Should have just done this in the first place.  The problem was that the first modal form opened doesn't yield control to the second modal form opened...  won't even listen for DoEvents.  Yuck.

Anyway... the solution was cake once it hit me:  Created my own simple Zoom form.  Modified the autoshutdown form in two places.  During the countdown, if the Zoom form is open, the autoshutdown sets Modal = False on the Zoom form and focus to itself.  The cancel buttons click event cancels the shutdown, sets focus back to the zoom form, and sets the zoom forms Modal = True. Voila.  Took less time to prototype than it did to ask the questions.

Sometime Brut force and simplicity wins.  I have to stop trying to be too slick.

Thanks again for your help.
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility
Just having someone to explain the trouble to sometimes helps best :-)

Nic;o)
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now