UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Link From Access Form To Ie Causing Issues, Access 2016    
 
   
HJMLII
post Apr 15 2019, 12:43 PM
Post#1



Posts: 6
Joined: 22-March 19



I am running Access 2016 in Windows 10, and I have a Form pulling up information based on a query including a "Work Order Number". From that form I am clicking on a button which takes the "Work Order Number" and plugs it into a URL which takes me directly to the required page in my company's intranet. This is working perfectly as intended, however after successful uses a few times, some users will have the new Internet Explorer window be "stuck" at the bottom of the taskbar and are unable to do anything with it (move, resize, etc.). Upon opening the Task Manager they are finding multiple IEs still open under processes. When I end one of these, all the rest end and the linked button begins working as intended again. This is extremely frustrating for the users because in order to get to the desired page the user must login with their company credentials each time this happens. I have scoured the internet and cannot find any similar issues. Any help would be extremely helpful.
Go to the top of the page
 
June7
post Apr 15 2019, 01:03 PM
Post#2



Posts: 460
Joined: 25-January 16



Post your code.

--------------------
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.

DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
HJMLII
post Apr 15 2019, 02:53 PM
Post#3



Posts: 6
Joined: 22-March 19



Below is the code...again, it is working for everyone using it through the first few attempts, then this issue happens, although we cannot point to a suspected cause or trigger.

Private Sub Command111_Click()
'Correspondence Log
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
Dim oHTML_Element As IHTMLElement
Dim sURL As String

On Error GoTo Err_Clear
sURL = "https://service.company.com/repairOrderNotifications.do?workOrder=" & [workorder]
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.Navigate sURL
oBrowser.Visible = True

Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If

End Sub
Go to the top of the page
 
isladogs
post Apr 15 2019, 03:50 PM
Post#4



Posts: 1,306
Joined: 4-June 18
From: Somerset, UK


Two things
1. When you defined IE you didn't specify as what. So it becomes a variant. Instead Dim IE as object.

2. Each time your code runs you are creating a new instance of IE. Once the object has been created, you should subsequently use GetObject.
I'm not at my computer now but you should be able to do a search for code that handles both cases including the use of error handling for error 429 IIRC.



--------------------
Go to the top of the page
 
June7
post Apr 15 2019, 10:41 PM
Post#5



Posts: 460
Joined: 25-January 16



Something like:
CODE
On Error Resume Next
Set IE = GetObject(, "InternetExplorer.Application")
If Err.Number = 429 Then
    Set IE = CreateObject("InternetExplorer.Application")
End If


--------------------
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.

DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
isladogs
post Apr 16 2019, 12:30 PM
Post#6



Posts: 1,306
Joined: 4-June 18
From: Somerset, UK


I would do something like this:

CODE
Private Sub Command111_Click()

On Error GoTo Err_Handler

Dim IE As Object

'If IE open, bind to existing instance - if not error 429 will occur
   Set IE = GetObject(, "InternetExplorer.Application")

... other code here .....

Exit_Handler:
    Exit Sub

Err_Handler:
    If Err.Number = 429 Then 'IE is not running; open with CreateObject
      Set IE = CreateObject("InternetExplorer.Application")
      Resume Next
  Else
       MsgBox "Error " & err.Number & " : " & err.Description
       Resume Exit_Handler
    End If

End Sub

This post has been edited by isladogs: Apr 16 2019, 01:24 PM

--------------------
Go to the top of the page
 
June7
post Apr 16 2019, 01:22 PM
Post#7



Posts: 460
Joined: 25-January 16



Are the double periods a typo? InternetExplorer..Application

--------------------
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.

DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
isladogs
post Apr 16 2019, 01:25 PM
Post#8



Posts: 1,306
Joined: 4-June 18
From: Somerset, UK


Ah the perils of copy and paste.
Thanks for spotting that. I've now fixed both typos

--------------------
Go to the top of the page
 
HJMLII
post Apr 17 2019, 01:04 PM
Post#9



Posts: 6
Joined: 22-March 19



Thank you for the responses. I have put in the new code, however the same issue continues to happen, more with two specific users however each are using the same systems and programs. Could this issue possibly be something with the Internet Explorer application itself?
Go to the top of the page
 
June7
post Apr 17 2019, 02:13 PM
Post#10



Posts: 460
Joined: 25-January 16



Some users do not have this issue? Only two do? Same issue with user logged onto a different computer?
This post has been edited by June7: Apr 17 2019, 02:26 PM

--------------------
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.

DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
isladogs
post Apr 17 2019, 02:18 PM
Post#11



Posts: 1,306
Joined: 4-June 18
From: Somerset, UK


QUOTE
however the same issue continues to happen, more with two specific users however each are using the same systems and programs. Could this issue possibly be something with the Internet Explorer application itself?


This sounds like you have several users sharing the same copy of your Access application & therefore IE as well.
If that is the case you will have major problems and at some point end up with a corrupted database

In a multi user environment, the application should be split with a shared backed database on the network and with each user having their own copy of the frontend on their own workstation.
Is that your setup?

--------------------
Go to the top of the page
 
HJMLII
post Apr 19 2019, 12:49 PM
Post#12



Posts: 6
Joined: 22-March 19



Each user has their own copy of the database which links to tables housed in a repository. Every user is having the issue however it seems to be happening much more frequently with two specific users. We continue to experience the issue which is very frustrating. Each time the user has to close out the IE application from the task manager they are forced to then sign back into the company system which is time consuming. If all is working correctly, they sign into the system once then use the button to open the hyperlink time and time again without signing in until this issue happens and they have to do it all again.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    25th April 2019 - 08:58 AM