Requery if form has focus (1 Viewer)

tacieslik

Registered User.
Local time
Today, 04:59
Joined
May 2, 2001
Messages
244
How can I run a .Requery event only if my form has focus?

I currently run an OnTimer event to do the following:


Private Sub Form_Timer()

Forms!frmMAIN.Requery

End Sub


I want to only do the requery if the form actually has the focus.

TIA
 

tacieslik

Registered User.
Local time
Today, 04:59
Joined
May 2, 2001
Messages
244
In addition to the above, I still need to use the timer event, but only when the form has focus.
 

Dugantrain

I Love Pants
Local time
Yesterday, 23:59
Joined
Mar 28, 2002
Messages
221
There is a form-level GotFocus event. If that doesn't trigger when you need, then the Activate event probably will.
 

Mile-O

Back once again...
Local time
Today, 04:59
Joined
Dec 10, 2002
Messages
11,316
Just to add that a form's GotFocus event will only execute if there is no control on the form that can receive the focus.
 

tacieslik

Registered User.
Local time
Today, 04:59
Joined
May 2, 2001
Messages
244
Thanks Mile-O-Phile, I think it was you that told me that in another post. Cheers.
 

Users who are viewing this thread

Top Bottom