FollowHyperlink on Form Results in UserName & PW Prompt

gopherking

Registered User.
Local time
Today, 18:06
Joined
May 26, 2011
Messages
31
I'm hoping someone can shed some light on this issue for me. I am generating a link to an Intranet site within our building which is comprised of a site address with the request ID retrieved from the current record on a Form. I am using the Access.FollowHyperlink command and when I click on the button and I am being prompted for a UserName and Password.

Here is the VBA code I'm using for reference (I know it is for a Text and not Button; but it follows the same idea):

PrivateSub Text70_Click()

Access.FollowHyperlink "website.com\reqid=" & [RequestID], , True

EndSub

I guess that my question is why am I being prompted for a Username and PW when I am accessing an Intranet site? And is there some way around this?

I have been racking my brain on this one for the past two days, please help me ... or shoot me!
 
Last edited:
What happens if you paste the URL into the browser directly and hit Enter?
 
If you paste the URL in the IE directly it works just fine without prompting the user for a login and PW. Currently, I have a text box in place that provides the users with the URL including the Request ID so they can copy/paste it into IE, but I would like to see if I can save them those few steps and send them to the webpage directly.
 
Okay, another question -

What happens if you use this instead (probably the same problem but just had to check)?

Code:
Access.FollowHyperlink "[B][URL="http://website.com/reqid"][COLOR=red]http://[/COLOR][/B]website.com[B][COLOR=red]/[/COLOR][/B]reqid[/URL]=" & [RequestID], , True
making sure the http part is there and that the part before reqid is a forward slash which it should be for a web URL.
 
Yep, same results. I should have mentioned that the http: was already included in my hyperlink, but when I pasted it into my thread, I got an error when I tried to submit it, so I had to remove it ... Sorry!
 
Not sure what happened, but now my hyperlink is working just fine .... :confused:
 
Ok, I have some more information on this issue ... I noticed that my button that directs me to my internal website all of a sudden stopped working again (really annoying since it was working just fine) and it got me thinking. The website that I am trying to access is not the highest level on the site, it is a sub page. Since it is also tied to my network login whether or not I should be able to access the sub page, I was wondering if since I am bypassing the main webpage if the login credentials are not being passed correctly to the site.

To test this, I restarted my PC and once I had my DB up and running, clicked on the button to see if it worked, which it did not and I was prompted for a login and password again. I then opened a IE and went to the main webpage, not directly to the subpage as in the DB, which opened just find. I then went back into my DB and clicked on the button again, and the subpage opens with no problems.

This even holds true if you go to the main page first and then close out your entire IE. The login information has been passed and established so that each time you open the subpage, it will now go directly there without prompting for a login and PW.

So, my work around for this issue right now is that in my OnClick, I have the database first do a FollowHyperlink to the Main webpage to establish the connection to the website, then do a second FollowHyperlink to the Sub page thus not prompting a user to login. However, this does present another issue that now I have two tabs open in my IE one of which is the main page and the secon being the sub page.

Is there a way to have the Access DB open the Main page and then close it before opening the second hyperlink? This would be ideal since it would be very quick and pretty much seamless to the user.
 
Ok, after some more searching through the forum, I came across the following thread:

http://www.access-programmers.co.uk/forums/showthread.php?t=176968

I have used the information found here to:
1) have a new IE window opened
2) Navigate to the main webpage in order for the login credentials to be applied automatically
3) Navigate to the sub webpage after the main webpage loaded, which is in the same window

By doing this, I don't need to close the first webpage that is opened as the second is opened in the same window. In addition, because this forces a new IE window to appear and it is brought to the front, the users don't have to search for the recently opened webpage in one of their existing IE windows. Here is the code that I used to do all this:

Code:
Private Sub Command108_Click()
    Dim ie As Object
    Set ie = CreateObject("internetexplorer.application")
    
    'Open Main Webpage that logs the user in automatically before going to Sub webpage
    ie.Navigate "[URL]http://www.yoursite.com/[/URL]"
    
    'Pause to allow Main Webpage to load before loading Sub Webpage
    While ie.busy
        DoEvents
    Wend
           
    'Open Sub Webpage and pause to load
    ie.Navigate "[URL]http://www.yoursite.com/SubWebpage[/URL]"
    While ie.busy
        DoEvents
    Wend
    
    'Bring the Webpage to the front of the user's screen
    ie.Visible = True
End Sub
 

Users who are viewing this thread

Back
Top Bottom