Switching between Access applications

  • Thread starter Thread starter Jonathan Blitz
  • Start date Start date
J

Jonathan Blitz

I want to give the user the option of opening one Access application from
with another.
I have used the Shell function to do that. Work ok.

Howeve, if that application is already open I want to be able to switch to
the open one and not open another instance. How can I do this?
--
Jonathan Blitz
AnyKey Limited
Israel

"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
 
Hi Jonathan

You can use the FindWindow Function,i.e.

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

the classname for Access is OMain

'This demonstrates three different ways to call FindWindow:
'1. The ClassName only.
'2. The Caption only.
'3. Both the ClassName and the Caption

MsgBox "Access Handle = " & FindWindow(lpClassName, 0&)
MsgBox "Access Handle = " & FindWindow(0&, lpCaption)
MsgBox "Access Handle = " & FindWindow(lpClassName, lpCaption)


Hope this helps

Best regards

Maurice St-Cyr
Micro Systems Consultants, Inc.
 
Once I get the handle back how do I then switch to the other application?


--
Jonathan Blitz
AnyKey Limited
Israel

Tel: (972) 8 9790365

Tel: (972) 8 9790365

"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
 
Back
Top