473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

FollowHyperlink, Then Set Focus to Linked App

When I click on a linked file on my form, I use the following code to execute the corresponding application (e.g. IE, Word, Excel):

Expand|Select|Wrap|Line Numbers
  1. Private Sub FilePath_Click()
  2.     Rem Me![AutoNumber]
  3.     Dim stlink As String
  4.         stlink = Me![FilePath]
  5.         FollowHyperlink stlink, , True
  6. End Sub
When the file opens, the corresponding application window flashes briefly and the focus is reset to the form. How can I ensure that the application window stays on top? I'm assuming that something is making the focus go back to the form.

Thanks in advance.
Dec 14 '07 #1
1 5348
MMcCarthy
14,534 Expert Mod 8TB
When I click on a linked file on my form, I use the following code to execute the corresponding application (e.g. IE, Word, Excel):

Expand|Select|Wrap|Line Numbers
  1. Private Sub FilePath_Click()
  2.     Rem Me![AutoNumber]
  3.     Dim stlink As String
  4.         stlink = Me![FilePath]
  5.         FollowHyperlink stlink, , True
  6. End Sub
When the file opens, the corresponding application window flashes briefly and the focus is reset to the form. How can I ensure that the application window stays on top? I'm assuming that something is making the focus go back to the form.

Thanks in advance.
Thats because Access still has focus. Try adding ...

Application.WindowState = wdWindowStateMinimise

to the end of your code and see if that helps.
Jan 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Lauren Quantrell | last post by:
I'm using the following code in Access 2000 to open a new MS Internet Explorer window with whatever URL value I pass to myURL: Application.FollowHyperlink myURL, , True (the True opens MS Internet...
2
by: Colleyville Alan | last post by:
I could not find this in the help file, so here goes... I have some code that opens a word doc which is then set to a variable called Target. Then a FollowHyperlink opens another word doc that...
2
by: S P Arif Sahari Wibowo | last post by:
Hi! Do you know how to put a form's Access-Visual-Basic-code that will force the form to be inserted, while the user has not type anything in the form, without changing focus, selection, etc.? ...
1
by: Jim Bayers | last post by:
This has been driving me crazy. server.transfer doesn't set the focus to the page I transfer to so when the user does a refresh, the results aren't what's expected. I have a datagrid on one...
2
by: AlastairHardwick | last post by:
Hi, Wonder if you can help? I have an Image Management Database which holds various information relating to Ghost Images and Testing. I am using a textbox with a hyperlink to display the path...
5
by: LabGeek | last post by:
I have an Access application that I have created that collects data from a scanner and from a weighting scale. The data from the scanner are unique identifiers (barcodes) and the scanner is...
0
by: mpfohl | last post by:
How do I use the FollowHyperlink method to go to a .asp website and automatically enter in the parameters to run a search and go to the search results page? E.g., if the site is a driving...
7
by: fpesante | last post by:
Hi, I I'm trying to create a form on database that user can choose and adress from a list box then click on a command button and they will be able to open the site. I am not able to retreive the...
5
by: Ruben | last post by:
Hello, I am using the "Application.FollowHyperlink strFilePath, , True" line of code from within access forms to launch any file type I want (e.g., xls, doc, pdf, etc.). The files open up okay,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.