Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

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

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
steverke
Asked:
steverke
  • 5
  • 4
1 Solution
 
nico5038Commented:
Did you place a DoEvents in the countdown loop ?

Nic;o)
0
 
steverkeAuthor Commented:
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
 
nico5038Commented:
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
steverkeAuthor Commented:
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
 
nico5038Commented:
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
 
steverkeAuthor Commented:
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
 
nico5038Commented:
Let me know when I can assist.

Success with the application !

Nic;o)
0
 
steverkeAuthor Commented:
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
 
nico5038Commented:
Just having someone to explain the trouble to sometimes helps best :-)

Nic;o)
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now