Hey Everyone
I am trying to use an existing webform to lookup and then update a record.
The first thing I have done is opened the search page and populated the text box and submit the form.
This then load the page with the record details which are presented in a prepopulated webform. It works to this point.
What I am looking to do is update the webform with data from a worksheet.
This is my code so far.
I have read a number of posts but still haven't figured this out.
Any help would be appreciated.
Brian
I am trying to use an existing webform to lookup and then update a record.
The first thing I have done is opened the search page and populated the text box and submit the form.
This then load the page with the record details which are presented in a prepopulated webform. It works to this point.
What I am looking to do is update the webform with data from a worksheet.
This is my code so far.
Rich (BB code):
Private Sub CommandButton2_Click()
Dim referral As String
Dim refbrand As String
Dim ie As Object
refbrand = Worksheets("sheet2").Range("D4").Value 'dropdown
referral = Worksheets("sheet2").Range("C3").Value
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "http://www.example.com"
Do Until .ReadyState = 4: DoEvents: Loop
End With
Set RefID = ie.Document.all.Item("referral")
RefID.Value = referral
ie.Document.forms(0).submit
'===============Populate form
Set brand = ie.Document.all.Item("refbrand")
brand.Value = refbrand
' Do While ie.ReadyState <> 4: DoEvents: Loop
' Do While ie.Busy: DoEvents: Loop
'============END POpulate form
End Sub
I have read a number of posts but still haven't figured this out.
Any help would be appreciated.
Brian
Last edited: