Solved

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

Posted on 2004-03-26
9
307 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
ID: 10691537
Did you place a DoEvents in the countdown loop ?

Nic;o)
0
 

Author Comment

by:steverke
ID: 10704447
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
ID: 10704763
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:steverke
ID: 10704892
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
 
LVL 54

Accepted Solution

by:
nico5038 earned 500 total points
ID: 10705118
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
ID: 10705273
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
ID: 10705340
Let me know when I can assist.

Success with the application !

Nic;o)
0
 

Author Comment

by:steverke
ID: 10705511
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
ID: 10705584
Just having someone to explain the trouble to sometimes helps best :-)

Nic;o)
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

831 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