By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,192 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,192 IT Pros & Developers. It's quick & easy.

Issues with FollowHyperlink not acting same a directly typing address in explorer

P: 6
I can provide the address for a bound value from a form and pass it into a function;

However I don't want to click that value on the form for it to be recognized when performing the action desired in my function. Since the value on the form is derived from a query am I not able to pass that value directly to the function?

In other words, what address do I put in my runcode macro when calling up the function?

funcname (query address for value?)

when calling up a bound value from a list on a form, I type the following which works:
funcname (forms!formname!objname)

or do I just have to grab the SQL from the query and embed it in the function. Didn't want to because it is a long web address.

Thank you for your Help
Nov 6 '12 #1
Share this Question
Share on Google+
11 Replies


P: 6
I'm accessing a web site to download mutual fund info.

When I type in the address the site (yahoo finance) asks if I want to open or save file.

However, when I use FollowHperlink the file opens automatically in excel and I have to go thru a series of SendKeys and wait steps to save the file to upload in my access tables.

Is there a control I don't see? It is like it adds an "enter" keystroke when using FollowHyperlink and therefore opens the file?

Or am I stuck with this series of steps.

Thank you in advance for your help
Nov 6 '12 #2

zmbd
Expert Mod 5K+
P: 5,397
As a chemist I read and follow a lot of very weird and unusally worded documentation... however, I can't make heads or tails of what you want... one more try please as from what little you have given us does sound like an interesting puzzle.
Nov 7 '12 #3

TheSmileyCoder
Expert Mod 100+
P: 2,321
If you have a stored query you can use one of the domain functions DlookUp, Dmax/Dmin or dcount to get the value.

But as zmbd says, your post is a bit confusing. Please remember that we do not have your application in front of us, nor do we even know what the purpose is. It's a good idea before hitting that submit button to take a minute to just read through your question with "fresh" eyes and make sure it makes sense to someone besides yourself.

Bear in mind that the one who benefits most from a good question is yourself. Many experts skip poorly phrased question and focus on others.
Nov 7 '12 #4

zmbd
Expert Mod 5K+
P: 5,397
please post your code.
please remember to format it using the <CODE/> button.

It sounds as though your reference is to the actual file within your code when you would prefer to open the webpage. However, as we do not have your application in front of us nor any part of the calling code, it is impossible to help you find a good solution.
Nov 7 '12 #5

P: 6
The website has a link to download historical data. The address is:

http://ichart.finance.yahoo.com/tabl...=d&ignore=.csv

When I enter that address in a web browswer directly a Windows explorer popup asks "What do you want to do with table.csv? with 3 options "Open" "Save" or "SaveAs".

My problem is when I have a function that reads in the exact same web address as follows:

Expand|Select|Wrap|Line Numbers
  1. Private Function CallHyperlink (WebAddress as String)
  2.     FollowHyperlink WebAddress
  3. End Funtion
I don't get the same screen. The file is opened up in excell just like an "Enter" key has been entered after I enter the web address in a normal web browser window whick then opens the file in excell.

Can that behavior be prevented? If not I have a series of Send Key steps to save the opened excel file and that series of steps is not optimal.

Thank you for any help!
and a series of other input
Nov 7 '12 #6

P: 6
Zmbd
I also am a chemist, so you understand why I write confusing posts!

I have a simple query

Expand|Select|Wrap|Line Numbers
  1. Public Function CallHyperlink(WebAddress as String)
  2.     FollowHyperlink WebAddress
  3. End Funtion
If I place the Web address in a list box on a form I can run the code in a macro using:
CallHyperlink(forms!formname!objectName)
I don't want to do this because the web address in the list on the form needs to be selected even if my query only has one web address.

Therefore I want to find the easiest way to access the value in my my query like I access the value in the objectName from the list on the form. Is this possible?

I hope that is clearer.

Thanks
Nov 8 '12 #7

Rabbit
Expert Mod 10K+
P: 12,366
I have merged your two threads. Please do not create more than one thread for the same question. Also, please use code tags when posting code.
Nov 8 '12 #8

NeoPa
Expert Mod 15k+
P: 31,494
HSPrentice:
I also am a chemist, so you understand why I write confusing posts!
That only explains why you should understand as well as anyone the importance of considering what you post before you post it.

The behaviour you mention that you get when dealing with a web browser is due to web browsers providing extra functionality on top of the very basics as provided by the OS. You won't find that done for you (as it is in most browsers) unless you can find some code on the web that's been prepared already. If you want that functionality then I'm afraid you will need to consider exactly what you need and program that in.

The idea of finding pre-prepared code is certainly not hopeless, but that isn't what we do here I'm afraid (unless one of our experts manages to find a link for you they feel might help of course). Someone may also be prepared to help you through the process of doing it yourself, but they'd need you to communicate your precise requirements as well as one would expect from a chemist ;-)
Nov 8 '12 #9

P: 6
Thank you:
The dlookup works for one of the issues asked about.

I hadn't used dlookup in access only excel. Thank you very much.

I realize this part was a basic question, but often those basic questions seem to be the types of questions I can't find answeres for in access help searches.

Thanks again
Nov 8 '12 #10

P: 6
Neo Pa
Thank you for your response. I'm not sure I totally understand your response, however, it sounds as though you think it is a browser issue and I can't do much about it.

During earlier research and attempts to make things work I did notice that IE9 and GoogleChrome did different things. I was able to create a work around for IE9.

IE9 is definitely is doing different things when I "paste" in a website address versus passing the website address via "followhyperlink" function in access.

I will have to revisit GoogleChrome and see if fewer "send key" commands and "waitseconds" between the commands are required with that browser to minimize annoyances (I'll be loading the file from the website 50-100 daily or weekly)

The extra steps while currently working automatically (because of a work around) are annoying and I have up to 10 seconds of waiting to ensure each step is completed. A single "send keys" command for saving the file would be great if the browser responded the same way for a "cut and paste" web address versus the "follow hyperlink" opening the file in excell.

Again thanks for your help I apolozie for any lack of clarity.
A.
Nov 8 '12 #11

NeoPa
Expert Mod 15k+
P: 31,494
HSPrentice:
It sounds as though you think it is a browser issue and I can't do much about it.
Pretty close, although it is possible to do something about it. It just takes a little more than basic coding. I would only recommend that if the need is urgent and you're prepared to do what it takes to work with someone towards a solution. Not trivial, but possible then.
Nov 8 '12 #12

Post your reply

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