Lose focus of application (1 Viewer)

Kayleigh

Member
Local time
Today, 06:49
Joined
Sep 24, 2020
Messages
706
Hi there,
I have a weird issue with my system that it will not allow left-click for about five minutes after loading. Apparently the workaround is to lose focus of application and reset focus. How would I code this please?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:49
Joined
Feb 28, 2001
Messages
27,001
Sounds like it is doing something and hasn't completed yet. Do you have an Opening Form defined? If so, what is going on with either the FORM_OPEN or FORM_LOAD routine? If there IS a culprit in your app, there is where I would look.
 

Isaac

Lifelong Learner
Local time
Yesterday, 23:49
Joined
Mar 14, 2017
Messages
8,738
1: During those 5 minutes, what is the cursor doing? An hourglass or anything different than the regular cursor hand default?

2: Are you saying that at ANY time during those 5 minutes, all you have to do is cause the application to be brought to the fore - like, for example, using Alt+Tab a couple times, and then everything works normally? So it's not actually 'frozen' ?
 

Kayleigh

Member
Local time
Today, 06:49
Joined
Sep 24, 2020
Messages
706
No its not frozen - I can click on command buttons (so a regular user can function but not me as the system developer). If I move out of the application - like hit the Windows start key it will revert to regular functionality. So that's the only workaround I have come across so far...
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:49
Joined
Feb 28, 2001
Messages
27,001
You need to see what is going on here. As a diagnostic tool, I would implement a logging table with a SINGLE field and a short text field. Then as the very first instruction in your opening form's FORM_OPEN routine, make an entry in that logging table, like:

Code:
CurrentDB.Execute "INSERT INTO LogTable (TStamp, TPlace) VALUES ( "& Cstr(Timer()) & ", Waypoint 1" ) ;"

Sprinkle some of those around your code in various events on each form with different waypoint number or other text so that you know where each waypoint is located. See if you can figure out which action or event is hanging up. If you weren't familiar with it, TIMER() gives you back a SINGLE number = milliseconds since midnight.

I often use this approach by bracketing subroutines I'm using with a waypoint before and another waypoint after. (Only when I'm suspicious of the new subroutine or functions.)

The first test is therefore not to try to program a lose app focus/gain app focus - which would be problematic anyway - but rather to try to find where your time-killer resides.
 

Users who are viewing this thread

Top Bottom