Website: http://www.cookcountypropertyinfo.com/default.aspx. I wanted to automate the process of inputting values in 'BY PIN' section and then submit 'Search' button. Below mentioned code fills into 'BY PIN' section but it fails the validation criteria and returning error message. However, manually inputting same value returning result. I am unable to figure out what is missing in my code.
Private Sub Command443_Click()
Dim PINArray() As String
PINArray() = Split(PINText, "-")
Set objie = CreateObject("InternetExplorer.Application")
WebSite = "http://www.cookcountypropertyinfo.com/default.aspx"
DoCmd.Hourglass True
With objie
.Visible = False
.navigate WebSite
Do While .Busy Or .ReadyState <> 4
DoEvents
Loop
.Visible = True
Set element = .Document.getElementsByName("ctl00$ContentPlaceHolder1$PINAddressSearch$pinBox1")
element.Item(0).Value = PINArray(0)
element.Item(0).fireevent "onkeyup"
Set element = .Document.getElementsByName("ctl00$ContentPlaceHolder1$PINAddressSearch$pinBox2")
element.Item(0).Value = PINArray(1)
element.Item(0).fireevent "onkeyup"
Set element = .Document.getElementsByName("ctl00$ContentPlaceHolder1$PINAddressSearch$pinBox3")
element.Item(0).Value = PINArray(2)
element.Item(0).fireevent "onkeyup"
Set element = .Document.getElementsByName("ctl00$ContentPlaceHolder1$PINAddressSearch$pinBox4")
element.Item(0).Value = PINArray(3)
element.Item(0).fireevent "onkeyup"
Set element = .Document.getElementsByName("ctl00$ContentPlaceHolder1$PINAddressSearch$pinBox5")
element.Item(0).Value = PINArray(4)
element.Item(0).fireevent "onkeyup"
element.Item(0).fireevent "onkeydown"
Set element = .Document.getElementsByName("ctl00$ContentPlaceHolder1$PINAddressSearch$btnSearch")
element.Item(0).Click
End Sub