Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-03-26
9
Medium Priority
?
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 

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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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