change URL

stu_c

Registered User.
Local time
Today, 16:08
Joined
Sep 20, 2007
Messages
492
hi all
I have the below code and opens a webpage fills out the information and submits and works great, ideally I want it to open a different page once this is done, how can I get it to input a new website into the address bar and open this?

Code:
Public Function FUNC_ChangeDetailsl()

'Input data into Niche
    Dim IE As Object
    
'Create InternetExplorer Object
    Set IE = New InternetExplorerMedium
With IE
    .Visible = True
    .navigate "http://FRG/ChangeREF.asp?headerid=" & Mid([Forms]![FRM_TBLALL_FullDetails]![SFRM_TBLALL_ItemDetails].[Form]![OrderRef], 3, 8)
End With

For Each win In CreateObject("Shell.Application").Windows
    If win.Name Like "*Internet Explorer" Then
         Set IE = win: Exit For
    End If
Next

'Wait for IE to load
With IE
    Do Until .ReadyState = 4
        DoEvents
    Loop

'Input Data Into IE
Set oDoc = IE.Document
    'Red Seal
    oDoc.getElementsByName("NewREF").Item(0).Value = ([Forms]![FRM_TBLALL_FullDetails]![SFRM_TBLALL_ItemDetails].[Form]![OrderREF], 2, 7)
    oDoc.getElementsByName("Reason").Item(0).Value = "New Order"
    
   ' oDoc.all.Item("B1").Click
   ' oDoc.getElementsByTagName("B1")(0).Click

   End With

'*open new page 

End Function
 
Yes, once its filled out the details and clicked B1, I ideally need the window to open a new URL which contains a report so basically need to to insert the URL webpage into the already open window and navigate to it
 

Users who are viewing this thread

Back
Top Bottom