Forgive me if this is in the wrong place and feel free to move if it is. It may also be more of an HTML problem than a VBA one, but here goes...
I am using Access 2007 to update a page on an external website (amongst other things) from an Access form using VBA, but that page has recently changed. I have dealt with most of the issues around this, but there is still a problem that I cannot see how to resolve. Previously all the fields on the page were uniquely named, and so I was able to assign values from my form to them using
But now there appear to be identically named fields on the webpage and I cannot see how to differentiate between them in my code. I have attached a text file with the two relevant sections, containing the HTML for the two relevant sections on that page only (the code for the whole page runs to 8000+ lines and I can add the lot if really necessary) and as you will see the names for things like runs (name="result[][runs]") and wickets ("result[][wickets]") are the same in both sections. So how do I tell one from the other in my code?
Currently I have the following:
If you can follow all that, then please, can anyone help? How can I differentiate between the HTML field names in the attached file as simply as possible in my code above?
I am using Access 2007 to update a page on an external website (amongst other things) from an Access form using VBA, but that page has recently changed. I have dealt with most of the issues around this, but there is still a problem that I cannot see how to resolve. Previously all the fields on the page were uniquely named, and so I was able to assign values from my form to them using
Code:
.document.all.item(fieldname).value=...
Currently I have the following:
Code:
With objIE
.Visible = True
....
'1st innings - new HTML field names but duplicated on the webpage
.Document.all.Item("result[][runs]").value = nz(Me![runs_for#])
.Document.all.Item("result[][wickets]").value = nz(Me![wickets_for#])
.Document.all.Item("result[][overs]").value = nz(Me!ovf)
...
'2nd innings - still old HTML field names
.Document.all.Item("runs2").value = nz(Me![runs_against#])
.Document.all.Item("wickets2").value = nz(Me![wickets_against#])
.Document.all.Item("overs2").value = nz(Me!ova)
...
End With
Attachments
Last edited: