Solved Using a Variable for Folders with Application.HyperLink (1 Viewer)

JMHScot

New member
Joined
Sep 1, 2022
Messages
11
Hi, I have 2 buttons on a custom form containing onclick event procedures to create a hyperlink which use a variable named “Gallery” to deliver a numerical value, variable depending on what data is being viewed, to complete the webpage name. All webpages are sequentially numbered, e.g “gallery267.html – gallery268.html – gallery269.html” etc;

One button is to link directly to the on-line live website as below

Application.FollowHyperlink "Website Address not shown/gallery/pages/gallery" & Gallery & ".html"

The other button links to the off-line version of the same website for local off-line users, as below

Application.FollowHyperlink "D:/WebDesign/Walkslog/gallery/pages/gallery" & Gallery & ".html"

Now, I have no problem with these links, they work perfectly well and always have done since created some years ago.

However, I now want to added a third button to link to a jpg image which is only required by the off-line user. The image has a fixed filename, “map.jpg”, it is the folder in which it is stored that has the variable, the same variable as its associated web page, e.g.”/g267/map.jpg” is associated with “gallery267.html”.

Naively I thought I could use much the same syntax as for the off-line file webpages, only this time apply the variable to the folder name containing “map.jpg”, as below

Application.FollowHyperlink "D:/WebDesign/Walkslog/gallery/g " & Gallery & "/map.jpg"

However that does not work, and I am stuck having tried a number of options, therefore, I would be grateful if someone can correct the syntax for me.

Thanks JMH
 
Syntax looks OK to me?, however you would need to create the folder first?, plus you would only ever have one picture in each folder?
 
Perhaps it doesn't work because there is a space character that you accidentally added to the folder's name?
 
Syntax looks OK to me?, however you would need to create the folder first?, plus you would only ever have one picture in each folder?
Hi Gasman, All folders are already created and populated, but confused to why there should only be one picture in each folder, in fact if that is the case, then I am stumped as all the folders contain multiple jpg files alongside of map.jpg
 
Perhaps it doesn't work because there is a space character that you accidentally added to the folder's name?
Damm! I have spent the last couple of hours looking at that, an extra space - take it away and it works. Thank you, theDBguy.
 
Damm! I have spent the last couple of hours looking at that, an extra space - take it away and it works. Thank you, theDBguy.
Glad to hear you got it to work. Good luck with your project.
 

Users who are viewing this thread

Top Bottom