Thank you in advance for any help given. I am trying to open an intranet page and then search on that page for information which is contained in a text box (txtMan) on a form.
Issue: The search is not happening on the opened webpage but on the MS Access form and any "setfocus" line is not working. Also I can not figure out how to return a message if text is found versus text not found.
Private Sub cmdSearch_Click()
On Error GoTo Error_cmdSearch
Dim strHyperlink As String
strHyperlink = Me.hypSearch
Application.FollowHyperlink strHyperlink, , True
If Len(Me.txtMan.Value & vbNullString) > 0 Then
SendKeys "^f", False
SendKeys Me.txtMan.Value, False
SendKeys "{ENTER}", False
SendKeys "{ESC}", False
End If
''**************************************************
' If statement based on returned value from search
' If true
' MsgBox "Text found on the website"
'Else
'MsgBox "Text not found on the website"
'End IF
''**************************************************
Exit_cmdSearch:
Exit Sub
Error_cmdSearch:
MsgBox Err & ": " & Err.Description
Resume Exit_cmdSearch
End Sub
Issue: The search is not happening on the opened webpage but on the MS Access form and any "setfocus" line is not working. Also I can not figure out how to return a message if text is found versus text not found.
Private Sub cmdSearch_Click()
On Error GoTo Error_cmdSearch
Dim strHyperlink As String
strHyperlink = Me.hypSearch
Application.FollowHyperlink strHyperlink, , True
If Len(Me.txtMan.Value & vbNullString) > 0 Then
SendKeys "^f", False
SendKeys Me.txtMan.Value, False
SendKeys "{ENTER}", False
SendKeys "{ESC}", False
End If
''**************************************************
' If statement based on returned value from search
' If true
' MsgBox "Text found on the website"
'Else
'MsgBox "Text not found on the website"
'End IF
''**************************************************
Exit_cmdSearch:
Exit Sub
Error_cmdSearch:
MsgBox Err & ": " & Err.Description
Resume Exit_cmdSearch
End Sub