Hello all,
I have got some VBA code that automatically opens up the correct intranet webpage via reference numbers in other fields, ideally what I want is when a user clicks out of the field it searches the website for the words "Incorrect Ref", if this happens then to do an If statement to show up a popup box indication incorrect REF number. any suggestions how to do this?
This is the code used to open the form, as mentined ideally want it to search for the words "Incorrect", close down the webpage and show a pop up screen on the form.
I have got some VBA code that automatically opens up the correct intranet webpage via reference numbers in other fields, ideally what I want is when a user clicks out of the field it searches the website for the words "Incorrect Ref", if this happens then to do an If statement to show up a popup box indication incorrect REF number. any suggestions how to do this?
This is the code used to open the form, as mentined ideally want it to search for the words "Incorrect", close down the webpage and show a pop up screen on the form.
Code:
Public Function FUNC_HRREFForm()
'Input data into Niche
Dim IE As Object
'Create InternetExplorer Object
Set IE = New InternetExplorerMedium
With IE
.Visible = True
.navigate "http://corp/ViewHRDetails.asp?Headerid=" & Mid([Forms]![FRM_TBLALL_FullHRDetails]![SFRM_TBLALL_StaffDetails].[Form]![HRRef], 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
End With
End Function