Set Focus Back To Access Application (1 Viewer)

ions

Access User
Local time
Yesterday, 22:40
Joined
May 23, 2004
Messages
785
Hello,

In my VBA I open the default browser using the following code.

Code:
 Application.FollowHyperlink "http://www.google.com", , False

Right after opening the browser I would like Focus to go back to Access.

How can I do this?

Thank you
 

pr2-eugin

Super Moderator
Local time
Today, 06:40
Joined
Nov 30, 2011
Messages
8,494
Try adding Me.SetFocus after the Application.FollowHyperlink line.
 

ions

Access User
Local time
Yesterday, 22:40
Joined
May 23, 2004
Messages
785
The code is executed from a report in Report View. Me.Setfocus doesn't seem to be available for reports.
 

ions

Access User
Local time
Yesterday, 22:40
Joined
May 23, 2004
Messages
785
Pr2. Thanks for that link. I was hopeful that it would work but Call fSetAccessWindow(SW_SHOWMAXIMIZED) did not set the focus back to Access for some reason.

Since every user will have IE installed I decided to use the following solution.

Set objIEapp = CreateObject("InternetExplorer.Application") 'Set IEapp = InternetExplorer

With objIEapp
.Silent = True 'No Pop-ups
.Visible = False

.....
.Quit
.....
 

Users who are viewing this thread

Top Bottom