Switching between Access applications

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."
 
S

StCyrM

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.
 
J

Jonathan Blitz

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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top