I have a button that opens up a web page below
This code then brings up the web page and submits the information below....as you can se I have edited it to not automatically click the submit button because when it does the page redirects to a different page with the same address, causing a runtime error because it cant find the fields on the new page. I dont know how to drill down to the iner code to stop this. So I disabled that and now I'm trying to manually click the "submit" button on the page to log in. However I am still getting a runtime error. I think it is because it is trying to run the code again and not finding the 2 fields on the new page. How can I stop the code from running When I click on the submit button on my page? esentially stopping the runtime error.Code:Private Sub cmdTimeClock_Click()
WebURL = "https://hrdirect.cox.com/psp/HRDIRECT/EMPLOYEE/HRMS/c/ROLE_EMPLOYEE.TL_SS_JOB_SRCH_CLK.GBL?NAVSTACK=Clear&PORTALPARAM_PTCNAV=HC_TL_SS_JOB_SRCH_CLK_GBL&EOPP.SCNode=HRMS&EOPP.SCPortal=EMPLOYEE&EOPP.SCName=HC_TIME_REPORTING&EOPP.SCLabel=My%20Time%20Reporting&EOP"
frmTimeClock.Show
End Sub
Code:Private Sub TimeClock_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If InStr(URL, WebURL) Then
TimeClock.Document.All("coxuserid").Value = "johndoe"
TimeClock.Document.All("pwd").Value = "xxxxxxxxxxxx"
'TimceClock.Document.All("submit").Click
' Redirects to a new page to select clock in or out
'TimeClock.Document.All("TL_RPTD_TIME_PUNCH_TYPE$0").selectedIndex = 1
Else
End If
End Sub
