FollowHyperlink Works/Doesn't Work (1 Viewer)

vito1010

Registered User.
Local time
Today, 01:51
Joined
Aug 14, 2014
Messages
33
I have two buttons on a form. One copies the Social Security Number and strips out the "-" then opens the IRS Refund Status website.
The second does the same thing but (is supposed to) open the NYS Refund Status site. (The urls both work if c/p into a browser).
The NYS one gives me an error:
Run-time Error: '8'
Cannot Download the Information You Requested



These are the two items:

Code:
Private Sub GoNYS_Click()
Me!Social.SetFocus
    Me!SS3 = Replace(Social, "-", "")
    Me!SS3.SetFocus
    DoCmd.RunCommand acCmdCopy

    Me!Social.SetFocus
    
    FollowHyperlink "https://www8.tax.ny.gov/PRIS/prisStart"
End Sub

Code:
Private Sub GoIRS_Click()
    Me!Social.SetFocus
    Me!SS3 = Replace(Social, "-", "")
    Me!SS3.SetFocus
    DoCmd.RunCommand acCmdCopy

    Me!Social.SetFocus
 
  FollowHyperlink "https://sa.www4.irs.gov/irfof/lang/en/irfofgetstatus.jsp"
End Sub

Any idea why the GoIRS works and the GoNYS doesn't. It did work at one time.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:51
Joined
Sep 21, 2011
Messages
14,299
Would have to do with the web page I suspect. They changed something at their end?
Personally I would just have one sub that determines where to go re the web page.

Just duplicate code there. :(
 

561414

Active member
Local time
Today, 00:51
Joined
May 28, 2021
Messages
280
No idea why Access doesn't like the link, but you can try a different approach to open it
Change FollowHyperlink "https://www8.tax.ny.gov/PRIS/prisStart"
with this Shell "explorer " & "https://www8.tax.ny.gov/PRIS/prisStart"
or maybe this Shell "cmd /c start " & "https://www8.tax.ny.gov/PRIS/prisStart"

Would have to do with the web page I suspect
The error comes from access, as far as I can tell
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:51
Joined
Sep 21, 2011
Messages
14,299
Just tried
Code:
FollowHyperlink "https://www8.tax.ny.gov/PRIS/prisStart"
in the immediate window. Always a good place to test one liners.

Works fine, too me straight to the site.
1686165905176.png
 

vito1010

Registered User.
Local time
Today, 01:51
Joined
Aug 14, 2014
Messages
33
I changed it to

Code:
Shell "explorer " & "https://www8.tax.ny.gov/PRIS/prisStart"

and that worked. I don't understand why the original stopped working. But, whatever. At least I got it working.
Thank you to all who helped.
 

Users who are viewing this thread

Top Bottom