Hi, the result of my query includes a field with file names that are located in an external folder. I would like click on these files and open them. How can I create links for the files? Any help on this would be appreciated
Hi, the result of my query includes a field with file names that are located in an external folder. I would like click on these files and open them. How can I create links for the files? Any help on this would be appreciated
Instead of just the file name, try putting the full path in the links.
Do I need to change the data type of the field? Also there are over 65K records!
My preference is to store the path as text. Another option is to add the path as a constant. So you could "hard code" the part of the path that is consistent, adding the file name to the path as needed.
There are a couple ways to turn text into a hyperlink. A button click could open a file, for instance.
I also use a plain text field. You can use FollowHyperlink to open the file, as well as other methods.
Followhyperlink may produce network security/access issues since that method is an old holdover that was meant for browsers. Opening a file in such a way can cause problems in Windows. A couple of methods that I have used is to use the File Dialog to open the folder (handy if there are several files in there that you want to open simultaneously). Another way is to use the Shell Execute or Shell Execute API (more powerful but a bit harder to use). If you know the file type, try the Shell function and see how it works for you. If you know the path, in code you could loop through the records and pass the file name to a little function that you use to open the file. It would then return and process the next function call. But surely you do not want to open all the files in the entire record list if it's as big as you say?
Shell """C:\....\MSACCESS.exe C:\Yourdb.mdb /Excl /x mcrStartup"""