Is the Find dialog box open?

  • Thread starter Thread starter sdl;kfj
  • Start date Start date
S

sdl;kfj

Is there a way for my event procedure to know if the Find dialogue box is
open? I'd like to perform one action if it is, a different action if it is
not.

I'm using Access 2003.

Thanks for any help
Ken
 
Hi Ken

The following code should work for you. It could possibly return a false
positive if there is another application running which has a "Find and
Replace" window open.

Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Public Function IsFindWindowOpen() As Boolean
IsFindWindowOpen = FindWindow("#32770", <> 0
End Function

Note the trailing space in "Find and Replace ".
 
Thanks, I'll give it a try.

Ken

Graham Mandeno said:
Hi Ken

The following code should work for you. It could possibly return a false
positive if there is another application running which has a "Find and
Replace" window open.

Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As Long

Public Function IsFindWindowOpen() As Boolean
IsFindWindowOpen = FindWindow("#32770", <> 0
End Function

Note the trailing space in "Find and Replace ".

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

sdl;kfj said:
Is there a way for my event procedure to know if the Find dialogue box is
open? I'd like to perform one action if it is, a different action if it
is not.

I'm using Access 2003.

Thanks for any help
Ken
 
Back
Top